Creating a new network

This menu option will allow us to create a new network from scratch:

public NNManager SetupNetwork()
{
_numInputParameters = 2;

int[] hidden = new int[2];
hidden[0] = 3;
hidden[1] = 1;
_numHiddenLayers = 1;
_hiddenNeurons = hidden;
_numOutputParameters = 1;
_network = new Network(_numInputParameters, _hiddenNeurons,
_numOutputParameters);
return this;
}

Notice our return value in this function. This is a fluent interface, meaning that various functions can be chained together into a single statement. Many people prefer this type of interface over the conventional one, but you can feel free to modify the code any way you like. The following is an example of what a fluent interface looks like. Believe it or not, this is a complete neural network:

NNManagermgr = new NNManager();
Mgr
.SetupNetwork()
.GetTrainingDataFromUser()
.TrainNetworkToMinimum()
.TestNetwork();
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset