Lably
Skip to content

Feedforward neural network

Type of artificial neural network

  • 5 min read
  • 3 chapters
  • 2 labs on Lably

Learn it on Lably

In reality, such textures and outlines would not be represented by single nodes, but rather by associated weight patterns of multiple nodes.

Mathematical foundations

Activation function

The two historically common activation functions are both sigmoids, and are described by

y(vi)=tanh⁡(vi)andy(vi)=(1+e−vi)−1.

The first is a hyperbolic tangent that ranges from -1 to 1, while the other is the logistic function, which is similar in shape but ranges from 0 to 1. Here yi is the output of the i-th node (neuron) and vi is the weighted sum of the input connections. Alternative activation functions have been proposed, including the rectifier and softplus functions. More specialized activation functions include radial basis functions (used in radial basis networks, another class of supervised neural network models).

In recent developments of deep learning, the rectified linear unit (ReLU) is more frequently used as one of the possible ways to overcome the numerical problems related to the sigmoids.

Learning

Learning occurs by changing connection weights after each piece of data is processed, based on the amount of error in the output compared to the expected result. This is an example of supervised learning, and is carried out through backpropagation.

We can represent the degree of error in an output node j in the n-th data point (training example) by ej(n)=dj(n)−yj(n), where dj(n) is the desired target value for n-th data point at node j, and yj(n) is the value produced at node j when the n-th data point is given as an input.

The node weights can then be adjusted based on corrections that minimize the error in the entire output for the n-th data point, given by

E(n)=12∑output node jej2(n).

Using gradient descent, the change in each weight wij is

Δwji(n)=−η∂E(n)∂vj(n)yi(n)

where yi(n) is the output of the previous neuron i, and η is the learning rate, which is selected to ensure that the weights quickly converge to a response, without oscillations. In the previous expression, ∂E(n)∂vj(n) denotes the partial derivative of the error E(n) according to the weighted sum vj(n) of the input connections of neuron i.

The derivative to be calculated depends on the induced local field vj, which itself varies. It is easy to prove that for an output node this derivative can be simplified to

−∂E(n)∂vj(n)=ej(n)ϕ′(vj(n))

where ϕ′ is the derivative of the activation function described above, which itself does not vary. The analysis is more difficult for the change in weights to a hidden node, but it can be shown that the relevant derivative is

−∂E(n)∂vj(n)=ϕ′(vj(n))∑k−∂E(n)∂vk(n)wkj(n).

This depends on the change in weights of the kth nodes, which represent the output layer. So to change the hidden layer weights, the output layer weights change according to the derivative of the activation function, and so this algorithm represents a backpropagation of the activation function.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication