Example #1
0
 /** Do full back propagation pass through the structure (calculate gradients) */
 public void backward() {
   if (updated) {
     return;
   }
   pipelines.forEach(value -> value.backward());
   layer.backward();
   updated = true;
 }
Example #2
0
 public Pipeline link(Pipeline pipeline, int socket) throws Exception {
   layer.link(pipeline.getInputLayer(), socket);
   pipelines.add(pipeline);
   return this;
 }
Example #3
0
 public Pipeline after(Pipeline pipeline) throws Exception {
   layer.link(pipeline.getInputLayer());
   pipelines.add(pipeline);
   return pipeline;
 }
Example #4
0
 /** Clear gradient in preparation for the next iteration */
 public void clearGrad() {
   layer.clearGrad();
   updated = false;
   pipelines.forEach(value -> value.clearGrad());
 }
Example #5
0
 /** Update weights according to the precomputed gradient */
 public void update(double learningRate) {
   layer.update(learningRate);
   updated = false;
   pipelines.forEach(value -> value.update(learningRate));
 }
Example #6
0
 /** Do full forward propagation pass through the structure */
 public void forward() {
   layer.forward();
   pipelines.forEach(value -> value.forward());
 }