Esempio n. 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;
 }
Esempio n. 2
0
 public Pipeline link(Pipeline pipeline, int socket) throws Exception {
   layer.link(pipeline.getInputLayer(), socket);
   pipelines.add(pipeline);
   return this;
 }
Esempio n. 3
0
 public Pipeline after(Pipeline pipeline) throws Exception {
   layer.link(pipeline.getInputLayer());
   pipelines.add(pipeline);
   return pipeline;
 }
Esempio n. 4
0
 /** Clear gradient in preparation for the next iteration */
 public void clearGrad() {
   layer.clearGrad();
   updated = false;
   pipelines.forEach(value -> value.clearGrad());
 }
Esempio n. 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));
 }
Esempio n. 6
0
 /** Do full forward propagation pass through the structure */
 public void forward() {
   layer.forward();
   pipelines.forEach(value -> value.forward());
 }