code: function(net, options) {
  
      this.net = net;
  
      var options = options || {};
      this.learning_rate = typeof options.learning_rate !== 'undefined' ? options.learning_rate : 0.01;
      this.l1_decay = typeof options.l1_decay !== 'undefined' ? options.l1_decay : 0.0;
      this.l2_decay = typeof options.l2_decay !== 'undefined' ? options.l2_decay : 0.0;
      this.batch_size = typeof options.batch_size !== 'undefined' ? options.batch_size : 1;
      this.method = typeof options.method !== 'undefined' ? options.method : 'sgd'; // sgd/adam/adagrad/adadelta/windowgrad/netsterov
  
      this.momentum = typeof options.momentum !== 'undefined' ? options.momentum : 0.9;
      this.ro = typeof options.ro !== 'undefined' ? options.ro : 0.95; // used in adadelta
      this.eps = typeof options.eps !== 'undefined' ? options.eps : 1e-8; // used in adam or adadelta
      this.beta1 = typeof options.beta1 !== 'undefined' ? options.beta1 : 0.9; // used in adam
      this.beta2 = typeof options.beta2 !== 'undefined' ? options.beta2 : 0.999; // used in adam
  
      this.k = 0; // iteration counter
      this.gsum = []; // last iteration gradients (used for momentum calculations)
      this.xsum = []; // used in adam or adadelta
  
      // check if regression is expected 
      if(this.net.layers[this.net.layers.length - 1].layer_type === "regression")
        this.regression = true;
      else
        this.regression = false;
    }
docs: convenience