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);
  }
 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);
 }
Esempio n. 3
0
 @Override
 protected ConnectionCalculator createInputFunction(
     SortedMap<GraphConnections, Integer> inputConnections,
     ValuesProvider valuesProvider,
     Layer targetLayer) {
   return new AparapiSigmoidFunction(inputConnections, valuesProvider.getColumns(), targetLayer);
 }