An Artificial Neuron
Figure 2.1: An Artificial Neuron.
The artificial neuron shown in Figure 2.1 is a very simple processing unit. The neuron has a fixed number of inputs ; each input is connected to the neuron by a weighted link i. The neuron sums up the input according to the equation: i=1n xi wi or expressed as vectors T w. To calculate the output a activation function is applied to the input of the neuron. This function is either a simple threshold function or a continuous non linear function. Two often used activation functions are:
C(net) = {11-e-net}
T(net) = {{ - if
- a >
- then
- 1
|
- else
- 0
|
}
The artificial neuron is an abstract model of the biological neuron. The strength of a connection is coded in the weight. The intensity of the input signal is modeled by using a real number instead of a temporal summation of spikes. The artificial neuron works in discrete time steps; the inputs are read and processed at one moment in time.There are many different learning methods possible for a single neuron. Most of the supervised methods are based on the idea of changing the weight in a direction that the difference between the calculated output and the desired output is decreased. Examples of such rules are the Perceptron Learning Rule, the Widrow-Hoff Learning Rule, and the Gradient descent Learning Rule.
The Gradient descent Learning Rule operates on a differentiable activation function. The weight updates are a function of the input vector , the calculated output , the derivative of the calculated output , the desired output , and the learning constant .
T w
A set of weights can only be found if the training set is linearly separable [mins69]. This limitation is independent of the learning algorithm used; it can be simply derived from the structure of the single neuron.
To illustrate this consider an artificial neuron with two inputs and a threshold activation function T; this neuron is intended to learn the XOR-problem (see table). It can easily be shown that there are no real numbers 1 and 2 to solve the equations, and hence the neuron can not learn this problem.
Input Vector | Desired Output | Weight Equation |
0 0 | 1 | 1 + 0 w2 > θ⇒0 > θ |
1 0 | 0 | 1 + 0 w2 < θ⇒w1 < θ |
0 1 | 0 | 1 + 1 w2 < θ⇒w2 < θ |
1 1 | 1 | 1 + 1 w2 > θ⇒w1 + w2 > θ |
Neural Network model
A neural network is put together by hooking together many of our simple “neurons,” so that the output of a neuron can be the input of another. For example, here is a small neural network:
In this figure, we have used circles to also denote the inputs to the network. The circles labeled “+1” are called bias units, and correspond to the intercept term. The leftmost layer of the network is called theinput layer, and the rightmost layer the output layer (which, in this example, has only one node). The middle layer of nodes is called the hidden layer, because its values are not observed in the training set. We also say that our example neural network has 3 input units (not counting the bias unit), 3 hidden units, and 1 output unit.
We will let denote the number of layers in our network; thus in our example. We label layer as , so layer is the input layer, and layer the output layer. Our neural network has parameters , where we write to denote the parameter (or weight) associated with the connection between unit in layer , and unit in layer . (Note the order of the indices.) Also, is the bias associated with unit in layer . Thus, in our example, we have , and . Note that bias units don’t have inputs or connections going into them, since they always output the value +1. We also let denote the number of nodes in layer (not counting the bias unit).
We will write to denote the activation (meaning output value) of unit in layer . For , we also use to denote the -th input. Given a fixed setting of the parameters , our neural network defines a hypothesis that outputs a real number. Specifically, the computation that this neural network represents is given by:
In the sequel, we also let denote the total weighted sum of inputs to unit in layer , including the bias term (e.g., ), so that .
Note that this easily lends itself to a more compact notation. Specifically, if we extend the activation function to apply to vectors in an element-wise fashion (i.e., ), then we can write the equations above more compactly as:
We call this step forward propagation. More generally, recalling that we also use to also denote the values from the input layer, then given layer ’s activations , we can compute layer ’s activations as:
By organizing our parameters in matrices and using matrix-vector operations, we can take advantage of fast linear algebra routines to quickly perform calculations in our network.
We have so far focused on one example neural network, but one can also build neural networks with other architectures (meaning patterns of connectivity between neurons), including ones with multiple hidden layers. The most common choice is a -layered network where layer is the input layer, layer is the output layer, and each layer is densely connected to layer . In this setting, to compute the output of the network, we can successively compute all the activations in layer , then layer , and so on, up to layer , using the equations above that describe the forward propagation step. This is one example of a feedforward neural network, since the connectivity graph does not have any directed loops or cycles.
Neural networks can also have multiple output units. For example, here is a network with two hidden layers layers and and two output units in layer :
To train this network, we would need training examples where . This sort of network is useful if there’re multiple outputs that you’re interested in predicting. (For example, in a medical diagnosis application, the vector might give the input features of a patient, and the different outputs ’s might indicate presence or absence of different diseases.)
No comments:
Post a Comment