Package com.github.neuralnetworks.calculation

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


  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);

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


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

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(c1.getOutputLayer(), 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.getOutputLayer(), 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.getOutputLayer(), 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.getOutputLayer(), 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.getOutputLayer(), i1);
  vp.addValues(c2.getOutputLayer(), 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.getOutputLayer(), i1);
  vp.addValues(c2.getOutputLayer(), i2);
  vp.addValues(ol, o);

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

  connections.add(bc);

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

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

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

  Matrix i = new Matrix(new float [] {2, 2}, 1);
  Set<Layer> calculated = new HashSet<>();
  calculated.add(mlp.getInputLayer());

  ValuesProvider results = new ValuesProvider();
  results.addValues(input, i);

  Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

  mlp.getLayerCalculator().calculate(mlp, output, calculated, results);
View Full Code Here

  c.getWeights()[15] = 4;

  Matrix i1 = new Matrix(new float[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }, 1);

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(nn.getInputLayer(), i1);

  Set<Layer> calculatedLayers = new HashSet<>();
  calculatedLayers.add(nn.getInputLayer());
  nn.getLayerCalculator().calculate(nn, nn.getOutputLayer(), calculatedLayers, vp);
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.