code: function () {
  			var N = this.N;
  
  			var cg = this.costGrad(this.Y); // evaluate gradient
  			var cost = cg.cost;
  			var grad = cg.grad;
  
  			var e = 1e-5;
  			for (var i = 0; i < N; i++) {
  				for (var d = 0; d < this.dim; d++) {
  					var yold = this.Y[i][d];
  
  					this.Y[i][d] = yold + e;
  					var cg0 = this.costGrad(this.Y);
  
  					this.Y[i][d] = yold - e;
  					var cg1 = this.costGrad(this.Y);
  
  					var analytic = grad[i][d];
  					var numerical = (cg0.cost - cg1.cost) / ( 2 * e );
  					console.log(i + ',' + d + ': gradcheck analytic: ' + analytic + ' vs. numerical: ' + numerical);
  
  					this.Y[i][d] = yold;
  				}
  			}
  		}
docs: for debugging: gradient check