Package com.github.neuralnetworks.architecture

Examples of com.github.neuralnetworks.architecture.NeuralNetworkImpl.addConnection()


  mlp.addLayer(input);

  Layer leaf1 = new Layer();
  FullyConnected fc1 = new FullyConnected(input, leaf1, 2, 3);
  Util.fillArray(fc1.getConnectionGraph().getElements(), 0.1f);
  mlp.addConnection(fc1);

  Layer leaf2 = new Layer();
  FullyConnected fc2 = new FullyConnected(input, leaf2, 2, 3);
  Util.fillArray(fc2.getConnectionGraph().getElements(), 0.2f);
  mlp.addConnection(fc2);
View Full Code Here


  mlp.addConnection(fc1);

  Layer leaf2 = new Layer();
  FullyConnected fc2 = new FullyConnected(input, leaf2, 2, 3);
  Util.fillArray(fc2.getConnectionGraph().getElements(), 0.2f);
  mlp.addConnection(fc2);

  Layer output = new Layer();
  FullyConnected fc3 = new FullyConnected(leaf1, output, 3, 1);
  Util.fillArray(fc3.getConnectionGraph().getElements(), 0.3f);
  mlp.addConnection(fc3);
View Full Code Here

  mlp.addConnection(fc2);

  Layer output = new Layer();
  FullyConnected fc3 = new FullyConnected(leaf1, output, 3, 1);
  Util.fillArray(fc3.getConnectionGraph().getElements(), 0.3f);
  mlp.addConnection(fc3);
  FullyConnected fc4 = new FullyConnected(leaf2, output, 3, 1);
  Util.fillArray(fc4.getConnectionGraph().getElements(), 0.4f);
  mlp.addConnection(fc4);

  mlp.setLayerCalculator(NNFactory.lcWeightedSum(mlp, null));
View Full Code Here

  FullyConnected fc3 = new FullyConnected(leaf1, output, 3, 1);
  Util.fillArray(fc3.getConnectionGraph().getElements(), 0.3f);
  mlp.addConnection(fc3);
  FullyConnected fc4 = new FullyConnected(leaf2, output, 3, 1);
  Util.fillArray(fc4.getConnectionGraph().getElements(), 0.4f);
  mlp.addConnection(fc4);

  mlp.setLayerCalculator(NNFactory.lcWeightedSum(mlp, null));

  Matrix i = new Matrix(new float [] {2, 2}, 1);
  Set<Layer> calculated = new HashSet<>();
View Full Code Here

    @Test
    public void testConvolutions() {
  NeuralNetworkImpl nn = new NeuralNetworkImpl();
  Conv2DConnection c = new Conv2DConnection(new Layer(), new Layer(), 3, 3, 2, 2, 2, 1, 1);
  nn.addConnection(c);
  c.getWeights()[0] = 1;
  c.getWeights()[1] = 2;
  c.getWeights()[2] = 3;
  c.getWeights()[3] = 4;
  c.getWeights()[4] = 1;
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.