@Test
public void testParallelNetworks() {
Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);
Environment.getInstance().setUseWeightsSharedMemory(true);
ConnectionFactory cf = new ConnectionFactory();
NeuralNetworkImpl mlp = new NeuralNetworkImpl();
Layer input = new Layer();
Layer leaf1 = new Layer();
Layer leaf2 = new Layer();
Layer output = new Layer();
mlp.addLayer(input);
FullyConnected fc1 = cf.fullyConnected(input, leaf1, 2, 3);
fc1.getWeights().forEach(i -> fc1.getWeights().getElements()[i] = 0.1f);
mlp.addConnections(fc1);
FullyConnected fc2 = cf.fullyConnected(input, leaf2, 2, 3);
fc2.getWeights().forEach(i -> fc2.getWeights().getElements()[i] = 0.2f);
mlp.addConnections(fc2);
FullyConnected fc3 = cf.fullyConnected(leaf1, output, 3, 1);
fc3.getWeights().forEach(i -> fc3.getWeights().getElements()[i] = 0.3f);
mlp.addConnections(fc3);
FullyConnected fc4 = cf.fullyConnected(leaf2, output, 3, 1);
fc4.getWeights().forEach(i -> fc4.getWeights().getElements()[i] = 0.4f);
mlp.addConnections(fc4);
mlp.setLayerCalculator(NNFactory.lcWeightedSum(mlp, null));