@Test public void backPropagateTest() { final Matrix[] activations = neuralNetwork.feedForward(input); assertTrue(MatrixUtils.compare(activations, expectedActivations, TOLERANCE)); final Matrix[] gradients = neuralNetwork.backPropagate(ArrayUtils.add(activations, 0, input), label); assertTrue(MatrixUtils.compare(expectedErrors, gradients, TOLERANCE)); }
public Matrix[] backPropagate(final Matrix[] activations, final Matrix label) { return backPropagateTo(1, activations, label); }
NeuralNetwork { public Matrix[] backPropagate(final Matrix[] activations, final Matrix label) { return backPropagateTo(1, activations, label); } }
NeuralNetwork { public Matrix[] backPropagate(final Matrix[] activations, final Matrix label) { return backPropagateTo(1, activations, label); } @Inject private  NeuralNetwork(final MatrixFactory matrixFactory,
                        final ConfigurationSerializer configurationSerializer,
                        @Parameter(SerializedLayerConfigurationSet.class) final Set<String> serializedLayerConfSets,
                        final ParameterProvider parameterProvider,
                        @Parameter(InputShape.class) final String inputShape,
                        final Injector injector); }
NeuralNetwork { public Matrix[] backPropagate(final Matrix[] activations, final Matrix label) { return backPropagateTo(1, activations, label); } @Inject private  NeuralNetwork(final MatrixFactory matrixFactory,
                        final ConfigurationSerializer configurationSerializer,
                        @Parameter(SerializedLayerConfigurationSet.class) final Set<String> serializedLayerConfSets,
                        final ParameterProvider parameterProvider,
                        @Parameter(InputShape.class) final String inputShape,
                        final Injector injector); LayerParameter[] getParameters(); void train(final Matrix input, final Matrix label); void train(final Matrix input, final int[] labels); Matrix[] feedForward(final Matrix input); Matrix[] feedForward(final int begin, final int end, final Matrix input); Matrix[] backPropagate(final Matrix[] activations,
                                final Matrix label); Matrix[] backPropagateTo(final int end,
                                  final Matrix[] activations,
                                  final Matrix label); Matrix[] backPropagateFromTo(final int begin, final int end,
                                      final Matrix[] activations,
                                      final Matrix nextError); LayerParameter[] generateParameterGradients(final Matrix[] activations,
                                                     final Matrix[] errors); LayerParameter[] generateParameterGradients(final int begin, final int end,
                                                     final Matrix[] activations,
                                                     final Matrix[] errors); }
NeuralNetwork { public Matrix[] backPropagate(final Matrix[] activations, final Matrix label) { return backPropagateTo(1, activations, label); } @Inject private  NeuralNetwork(final MatrixFactory matrixFactory,
                        final ConfigurationSerializer configurationSerializer,
                        @Parameter(SerializedLayerConfigurationSet.class) final Set<String> serializedLayerConfSets,
                        final ParameterProvider parameterProvider,
                        @Parameter(InputShape.class) final String inputShape,
                        final Injector injector); LayerParameter[] getParameters(); void train(final Matrix input, final Matrix label); void train(final Matrix input, final int[] labels); Matrix[] feedForward(final Matrix input); Matrix[] feedForward(final int begin, final int end, final Matrix input); Matrix[] backPropagate(final Matrix[] activations,
                                final Matrix label); Matrix[] backPropagateTo(final int end,
                                  final Matrix[] activations,
                                  final Matrix label); Matrix[] backPropagateFromTo(final int begin, final int end,
                                      final Matrix[] activations,
                                      final Matrix nextError); LayerParameter[] generateParameterGradients(final Matrix[] activations,
                                                     final Matrix[] errors); LayerParameter[] generateParameterGradients(final int begin, final int end,
                                                     final Matrix[] activations,
                                                     final Matrix[] errors);  }