Package com.neuralnetwork.shared.values

Examples of com.neuralnetwork.shared.values.ErrorValue


        for (ILink il : getInputs()) {
            sum += il.getWeight().getValue() * v.getValue();
        }
        DoubleValue n = new DoubleValue(getActivationFunction().activate(sum));
        setValue(n);
    return new ErrorValue(n.getValue());
    }
View Full Code Here


            sum += il.getWeight().getValue() * v.getValue();
        }
       
        DoubleValue n = new DoubleValue(getActivationFunction().activate(sum));
        setValue(n);
        ErrorValue e = ErrorValue.ZERO;
        for (ILink ol : getOutputs()) {
            e.updateValue(ol.getTail().feedforward(n, nnctx));
        }
    return e;
    }
View Full Code Here

        return feedforward(nnctx);
    }
   
    @Override
    public final ErrorValue feedforward(final INeuralNetContext nnctx) {
      ErrorValue v = null;
      for (ILink ol : getOutputs()) { //TODO FIX ME, Null at train time.
            v = ol.getTail().feedforward(getValue(), nnctx);
      }
    return v;
    }
View Full Code Here

    return 0;
  }

  @Override
  public ErrorValue getErrorStatus() {
    return new ErrorValue(
        expectedError.getValue()
        - currError.getValue());
  }
View Full Code Here

  public synchronized Double compute() {
   
   
    Vector<Double> output = network.runInputs(trainVector);
    LOGGER.debug("Network output: " + output);
    currError = new ErrorValue(
        ErrorFunctions.getInstance().meanSquaredError(
            output, trainVector));
    Iterator<IOutputNeuron> iter = network.getOutputLayer().iterator();
    Stack<Double> outputs = new Stack<Double>();
    outputs.addAll(output);
View Full Code Here

    @Override
    public synchronized ErrorValue train(final boolean online,
        final Vector<Double> trainingVector,
        final ErrorValue expectedError) {
      ErrorValue errorValue = new ErrorValue(0);
      toggleTraining();
//      if (!online) {
//          //reset();
//      }
      switch (getTrainAlgorithm()) {
      case BACKPROP:
          BackpropAlgorithm algo =
          new BackpropAlgorithm(trainingVector,
              trainingVector, this, expectedError);
          errorValue = new ErrorValue(algo.compute());
        break;
      case QPROP:
        break;
      case RPROP:
        break;
View Full Code Here

        }
    }

    @Override
    public IOutputLayer propagate(final INeuralNetContext nnctx) {
      ErrorValue v = new ErrorValue(Double.MAX_VALUE);
      synchronized (nnctx) {
          for (int i = 0; i < getSize(); i++) {
            v.updateValue(getNeuron(i).feedforward(nnctx));
          }
      }
      LOGGER.debug("Propagation Error: " + v.toString());
        return nnctx.getNetwork().getOutputLayer();
    }
View Full Code Here

   *
   * @return
   *     total error value
   */
  public final ErrorValue startTraining() {
    ErrorValue totalTrainError = new ErrorValue(0);
    while (!trainStack.getData().isEmpty()) {
      try {
        totalTrainError.updateValue(new ErrorValue(
        executorService.submit(
            new TrainNetworkSubTask(network,
                trainStack.popSample())).get()));
      } catch (InterruptedException | ExecutionException e) {
        LOGGER.error(e.getMessage());
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.values.ErrorValue#ErrorValue(double)}.
   */
  @Test
  public final void testErrorValue() {
    assertEquals(new ErrorValue(D_0_0023).getValue(),
        D_0_0023, Constants.TEN * Math.ulp(D_0_0023));
  }
 
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.values.ErrorValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.