A fast, lightweight and easy to use neural network library written in C#.
//Create a new NetworkFactory
var networkFactory = new Network.Factory();
//Set input size to 2
networkFactory.InputSize = 2;
//Add 2 layers
networkFactory.AppendLayer(LayerType.Sigmoid, 2);
networkFactory.AppendLayer(LayerType.Sigmoid, 1);
//Build the network
var network = networkFactory.Build();
//Generate training data
var input = new double[] { 0.123, 0.3466 };
var output = new double[] { 0.723 };
while (true)
{
//Train the network
network.Train(input, output, 0.01);
//Print out the error of the network
Console.WriteLine("Error: " + network.GetError(input, output));
}
Or take a look at the sample project here.
The neural network is trained using backpropagation.
If you are interested, you can watch this youtube video (It's really awesome):