public void propagateForward(Matrix input) {
   NeuralNetwork nn = getNeuralNetwork();
   Set<Layer> calculatedLayers = new UniqueList<Layer>();
   calculatedLayers.add(nn.getInputLayer());
   activations.addValues(nn.getInputLayer(), input);
   nn.getLayerCalculator().calculate(nn, nn.getOutputLayer(), calculatedLayers, activations);
 }
  public void propagateBackward(Matrix target) {
    NeuralNetwork nn = getNeuralNetwork();

    OutputErrorDerivative d = getProperties().getParameter(Constants.OUTPUT_ERROR_DERIVATIVE);
    Matrix outputErrorDerivative =
        d.getOutputErrorDerivative(activations.getValues(nn.getOutputLayer()), target);
    backpropagation.addValues(nn.getOutputLayer(), outputErrorDerivative);
    Set<Layer> calculatedLayers = new UniqueList<Layer>();
    calculatedLayers.add(nn.getOutputLayer());
    BackPropagationLayerCalculator blc = getBPLayerCalculator();
    blc.backpropagate(nn, calculatedLayers, activations, backpropagation);
  }