public double RunEpoch(double[][] input) { double error = 0.0; double[][] data = new double[input.Length][]; for (int i = 0; i < data.Length; i++) { data[i] = (double[])input[i].Clone(); } for (int i = 0; i < rbm_learnings.Length; i++) { Console.WriteLine(i); RBMLayer rbm = dbn.Layers[i]; rbm_learnings[i] = new RBMLearning(rbm); for (int j = 0; j < epoch; j++) { rbm_learnings[i].RunEpoch(data); } for (int j = 0; j < input.Length; j++) { data[j] = rbm.ComputeDown(data[j]); } } return(error); }
private double[] CalculateUpdate(double[] input) { x1 = input; Q = rbm.ComputeDown(input); h1 = this.Sampling(Q); h2 = h1; for (int i = 0; i < k; i++) { x2 = rbm.ComputeUp(h2); Q = rbm.ComputeDown(x2); h2 = this.Sampling(Q); } return(x2); }