public void AddHiddenLayer_WithoutInputLayer_ShouldThrowException() { NeuralNetworkBuilderTestDouble builder = new NeuralNetworkBuilderTestDouble(); builder.CreateNew(); NeuralNetwork network1 = builder.CurrentNeuralNetwork; ActivationFunction func = ActivationFunctions.Identity; AssertEx.AssertThrows <NeuralNetworkConfigurationException>(() => builder.AddHiddenLayer(2, func, true), "can't have only hidden layer"); }
public void AddHiddenLayer_CalledAfterAddOutpout_ShouldThrowException() { NeuralNetworkBuilderTestDouble builder = new NeuralNetworkBuilderTestDouble(); builder.CreateNew(); NeuralNetwork network1 = builder.CurrentNeuralNetwork; ActivationFunction func = ActivationFunctions.Identity; builder.AddInputLayer(3, func, false) .AddOutputLayer(4, func); AssertEx.AssertThrows <NeuralNetworkConfigurationException>(() => builder.AddHiddenLayer(5, func, false), "can't have hidden layer after the output layer"); }