Package com.github.neuralnetworks.calculation

Examples of com.github.neuralnetworks.calculation.ValuesProvider.addValues()


      ValuesProvider vp = mbe.getResults();
      if (vp == null) {
          vp = new ValuesProvider();
      }

      vp.addValues(n.getInputLayer(), input.getInput());
      n.getLayerCalculator().calculate(n, n.getOutputLayer(), calculatedLayers, vp);

      outputError.addItem(vp.getValues(n.getOutputLayer()), input.getTarget());
        }
View Full Code Here


  NNFactory.addFullyConnectedLayer(nn, h, 2, 3, true);
  NNFactory.addFullyConnectedLayer(nn, o, 4, 1, true);

  Matrix im = new Matrix(2, 2);
  vp.addValues(i, im);
  Matrix hm1 = vp.getValues(h, 3);
  Matrix hm2 = new Matrix(4, 2);
  vp.addValues(h, hm2);

  Matrix om = vp.getValues(o);
View Full Code Here

  Matrix im = new Matrix(2, 2);
  vp.addValues(i, im);
  Matrix hm1 = vp.getValues(h, 3);
  Matrix hm2 = new Matrix(4, 2);
  vp.addValues(h, hm2);

  Matrix om = vp.getValues(o);

  assertTrue(im == vp.getValues(i, 2));
  assertTrue(im == vp.getValues(i));
View Full Code Here

      }

      while ((input = ip.getNextInput()) != null) {
    calculatedLayers.clear();
    calculatedLayers.add(n.getInputLayer());
    results.addValues(n.getInputLayer(), input.getInput());
    n.getLayerCalculator().calculate(n, n.getOutputLayer(), calculatedLayers, results);

    if (getOutputError() != null) {
        getOutputError().addItem(results.getValues(n.getOutputLayer()), input.getTarget());
    }
View Full Code Here

  List<Connections> connections = new ArrayList<>();
  connections.add(c1);

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws.calculate(connections, vp, ol);

  // most simple case
View Full Code Here

  List<Connections> connections = new ArrayList<>();
  connections.add(c1);

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws.calculate(connections, vp, ol);

  // most simple case
  assertEquals(14, o.get(0, 0), 0);
View Full Code Here

  connections = new ArrayList<>();
  connections.add(c1);
  connections.add(bc);

  vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);
View Full Code Here

  connections.add(c1);
  connections.add(bc);

  vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);

  assertEquals(14.1, o.get(0, 0), 0.01);
View Full Code Here

  connections.add(c1);
  connections.add(c2);
  connections.add(bc);

  vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(c2.getInputLayer(), i2);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);
View Full Code Here

  connections.add(c2);
  connections.add(bc);

  vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(c2.getInputLayer(), i2);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.