<commit_before>NeuralNetwork = function(options) {
  this.learningRate = 0.5;
  this.growthRate = 0.5;
  if(options)
    this.setOptions(options);

  this.createLayers(this.hidden);
}

NeuralNetwork.prototype = {

  setOptions : function(options) {
    for(option in options)
      this[option] = options[option];
  },

  createLayers : function(hidden, json) {
    this.layers = [];

    var nlayers = 3; // one hidden layer is default
    if(hidden)
      nlayers = hidden.length + 2;
    else if(json)
      nlayers = json.layers.length;

    for(var i = 0; i < nlayers; i++) {
      if(hidden)
        var nnodes = hidden[i - 1];
      if(json)
        var layerJSON = json.layers[i];
      var layer = new Layer(this, layer, nnodes, layerJSON);
      this.layers.push(layer);
    }

    this.inputLayer = this.layers[0];
    this.outputLayer = this.layers[nlayers - 1];
    if(!hidden && !json)
      this.hiddenLayer = this.layers[1];
    else
      this.hiddenLayer = null;
  },

  run : function(inputs) {
    this.inputLayer.createNodes(inputs);
    if(this.hiddenLayer)
      this.hiddenLayer.growLayer(this.inputLayer.size);<commit_msg>add comment about hiddenLayer<commit_after>NeuralNetwork = function(options) {
  this.learningRate = 0.5;
  this.growthRate = 0.5;
  if(options)
    this.setOptions(options);

  this.createLayers(this.hidden);
}

NeuralNetwork.prototype = {

  setOptions : function(options) {
    for(option in options)
      this[option] = options[option];
  },

  createLayers : function(hidden, json) {
    this.layers = [];

    var nlayers = 3; // one hidden layer is default
    if(hidden)
      nlayers = hidden.length + 2;
    else if(json)
      nlayers = json.layers.length;

    for(var i = 0; i < nlayers; i++) {
      if(hidden)
        var nnodes = hidden[i - 1];
      if(json)
        var layerJSON = json.layers[i];
      var layer = new Layer(this, layer, nnodes, layerJSON);
      this.layers.push(layer);
    }

    this.inputLayer = this.layers[0];
    this.outputLayer = this.layers[nlayers - 1];
    if(!hidden && !json)
      this.hiddenLayer = this.layers[1]; // hold on to for growing
    else
      this.hiddenLayer = null;
  },

  run : function(inputs) {
    this.inputLayer.createNodes(inputs);
    if(this.hiddenLayer)
      this.hiddenLayer.growLayer(this.inputLayer.size);
{'fraction_non_alphanumeric': 0.13356164383561644, 'fraction_numerical': 0.009417808219178082, 'mean_word_length': 2.7693548387096776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5666904', 'n_tokens_mistral': 797, 'n_tokens_neox': 760, 'n_words': 161}