nn.setLayerCalculator(NNFactory.lcWeightedSum(nn, null));
Conv2DConnection cc = (Conv2DConnection) nn.getInputLayer().getConnections().get(0);
Util.fillArray(cc.getWeights(), 1);
ValuesProvider vp = new ValuesProvider();
vp.addValues(nn.getInputLayer(), new Matrix(new float[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}, 1));
Set<Layer> calculatedLayers = new HashSet<>();
calculatedLayers.add(nn.getInputLayer());
nn.getLayerCalculator().calculate(nn, nn.getOutputLayer(), calculatedLayers, vp);
Matrix o = vp.getValues(nn.getOutputLayer());
assertEquals(16, o.get(0, 0), 0.00001);
assertEquals(24, o.get(1, 0), 0.00001);
assertEquals(56, o.get(2, 0), 0.00001);
assertEquals(64, o.get(3, 0), 0.00001);
}