public void Evaluate_WithPassthroughAF_WithSingleInputAndOutput_ReturnsInputTimesWeight() { FullyConnectedNN nn = new FullyConnectedNN(new[] { 1, 1 }, AF.Passthrough); float[] output = nn.Evaluate(new[] { 1.0f }, new[] { 1.0f }); AssertFloat.AreAlmostEqual(1.0f, output[0]); output = nn.Evaluate(new[] { 0.5f }, new[] { 0.3f }); AssertFloat.AreAlmostEqual(0.15f, output[0]); }
public void Evaluate_WithPassthroughAF_WithMultipleHiddenLayers_WithMultipleInputAndOutput_ReturnsCorrect() { FullyConnectedNN nn = new FullyConnectedNN(new[] { 2, 2, 2 }, AF.Passthrough); float[] output = nn.Evaluate(new[] { 1.0f, -1.0f }, new[] { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f }); AssertFloat.AreAlmostEqual(-0.11f, output[0]); AssertFloat.AreAlmostEqual(-0.15f, output[1]); }