@Test public void testSigmoidBackPropagate() { final Matrix error = sigmoidActivationLayer.backPropagate(input, expectedSigmoidActivation, nextError); assertTrue(expectedSigmoidError.compare(error, TOLERANCE)); }
@Override public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix derivative = activationFunction.derivative(input); return nextError.mul(derivative); }
ActivationLayer extends LayerBase { @Override public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix derivative = activationFunction.derivative(input); return nextError.mul(derivative); } }
ActivationLayer extends LayerBase { @Override public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix derivative = activationFunction.derivative(input); return nextError.mul(derivative); } @Inject private  ActivationLayer(@Parameter(LayerIndex.class) final int index,
                          @Parameter(LayerInputShape.class) final String inputShape,
                          @Parameter(ActivationFunction.class) final String activationFunction); }
ActivationLayer extends LayerBase { @Override public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix derivative = activationFunction.derivative(input); return nextError.mul(derivative); } @Inject private  ActivationLayer(@Parameter(LayerIndex.class) final int index,
                          @Parameter(LayerInputShape.class) final String inputShape,
                          @Parameter(ActivationFunction.class) final String activationFunction); @Override int[] getOutputShape(); @Override boolean isLearnable(); @Override Matrix feedForward(final Matrix input); @Override Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError); @Override LayerParameter generateParameterGradient(final Matrix input, final Matrix error); }
ActivationLayer extends LayerBase { @Override public Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError) { final Matrix derivative = activationFunction.derivative(input); return nextError.mul(derivative); } @Inject private  ActivationLayer(@Parameter(LayerIndex.class) final int index,
                          @Parameter(LayerInputShape.class) final String inputShape,
                          @Parameter(ActivationFunction.class) final String activationFunction); @Override int[] getOutputShape(); @Override boolean isLearnable(); @Override Matrix feedForward(final Matrix input); @Override Matrix backPropagate(final Matrix input, final Matrix activation, final Matrix nextError); @Override LayerParameter generateParameterGradient(final Matrix input, final Matrix error);  }