Training a neural network
As you may have already summarized, a neural network is essentially useless until it is trained. Before we get into training, we should talk some more on how a neuron is activated. Open up the Neuron
class again and take a look at the CalculateValue
function. This method calculates the output based on its internal set of weights and is described by the following:
Here:
Also, keep the following in mind:
n = total number of neurons connected as inputsI = signaled input to the Neuron
class
O = calculated output
S = the sigmoid
function with a graph:
Sigmoid function
Sigmoid Function essentially distributes the weighted sum of values between 0
and 1
based on a curve (function) similar to the one shown in the preceding graph. We do this in order to evenly weigh the outputs of each of the neurons. Likewise, when we look to input data into a network, we also like to normalize the values between 0
and 1
. If we didn't do this, one single neuron or input could bias our entire network...