Backpropagation: Difference between revisions

Content deleted Content added
History: lots of missing references on the history of backpropagation
m Replace hyphen with en-dash.
 
(590 intermediate revisions by more than 100 users not shown)
Line 1:
{{Short description|Optimization algorithm for artificial neural networks}}
{{About|the computer algorithm|the biological process|Neural backpropagation}}
{{Hatnote|Backpropagation can also refer to the way the result of a playout is propagated up the search tree in [[Monte Carlo tree search#Principle of operation|Monte Carlo tree search]].}}{{Machine learning bar}}
{{multiple issues|
{{Expand German|Backpropagation|date=March 2009}}
{{Expand Spanish|Backpropagation|date=April 2013}}
{{technical|date=September 2012}}
{{update|date=November 2014}}
}}
{{Machine learning bar}}
 
In [[machine learning]], '''backpropagation''' is a [[gradient]] computation method commonly used for training a [[Neural network (machine learning)|neural network]] in computing parameter updates.
'''Backpropagation''', an abbreviation for "backward propagation of errors", is a common method of training [[artificial neural networks]] used in conjunction with an [[Mathematical optimization|optimization method]] such as [[gradient descent]]. The method calculates the gradient of a [[loss function]] with respect to all the weights in the network. The gradient is fed to the optimization method which in turn uses it to update the weights, in an attempt to minimize the loss function.
 
It is an efficient application of the [[chain rule]] to neural networks. Backpropagation computes the [[gradient]] of a [[loss function]] with respect to the [[Glossary of graph theory terms#weight|weights]] of the network for a single input–output example, and does so [[Algorithmic efficiency|efficiently]], computing the gradient one layer at a time, [[iteration|iterating]] backward from the last layer to avoid redundant calculations of intermediate terms in the chain rule; this can be derived through [[dynamic programming]].<ref name="kelley1960">{{cite journal |last1=Kelley |first1=Henry J. |author-link=Henry J. Kelley |year=1960 |title=Gradient theory of optimal flight paths |journal=ARS Journal |volume=30 |issue=10 |pages=947–954 |doi=10.2514/8.5282}}</ref><ref name="bryson1961">{{cite book |last=Bryson |first=Arthur E. |title=Proceedings of the Harvard Univ. Symposium on digital computers and their applications, 3–6 April 1961 |publisher=Harvard University Press |year=1962 |___location=Cambridge |chapter=A gradient method for optimizing multi-stage allocation processes |oclc=498866871}}</ref>{{sfn|Goodfellow|Bengio|Courville|2016|p=[https://www.deeplearningbook.org/contents/mlp.html#pf33 214]|ps=, "This table-filling strategy is sometimes called ''dynamic programming''."}}
Backpropagation requires a known, desired output for each input value in order to calculate the loss function gradient. It is therefore usually considered to be a [[supervised learning]] method, although it is also used in some [[Unsupervised learning|unsupervised]] networks such as [[autoencoder]]s. It is a generalization of the [[delta rule]] to multi-layered [[Feedforward neural network|feedforward networks]], made possible by using the [[chain rule]] to iteratively compute gradients for each layer. Backpropagation requires that the [[activation function]] used by the [[artificial neuron]]s (or "nodes") be [[differentiable]].
 
Strictly speaking, the term ''backpropagation'' refers only to an algorithm for efficiently computing the gradient, not how the gradient is used; but the term is often used loosely to refer to the entire learning algorithm. This includes changing model parameters in the negative direction of the gradient, such as by [[stochastic gradient descent]], or as an intermediate step in a more complicated optimizer, such as [[Stochastic gradient descent#Adam|Adaptive Moment Estimation]].<ref>{{harvnb|Goodfellow|Bengio|Courville|2016|p=[https://www.deeplearningbook.org/contents/mlp.html#pf25 200]}}, "The term back-propagation is often misunderstood as meaning the whole learning algorithm for multilayer neural networks. Backpropagation refers only to the method for computing the gradient, while other algorithms, such as stochastic gradient descent, is used to perform learning using this gradient."</ref>
==Motivation==
 
Backpropagation had multiple discoveries and partial discoveries, with a tangled history and terminology. See the [[#History|history]] section for details. Some other names for the technique include "reverse mode of [[automatic differentiation]]" or "[[reverse accumulation]]".<ref name="DL-reverse-mode">{{harvtxt|Goodfellow|Bengio|Courville|2016|p=[https://www.deeplearningbook.org/contents/mlp.html#pf36 217]–218}}, "The back-propagation algorithm described here is only one approach to automatic differentiation. It is a special case of a broader class of techniques called ''reverse mode accumulation''."</ref>
The goal of any [[supervised learning]] algorithm is to find a function that best maps a set of inputs to its correct output. An example would be a simple [[Classification (machine learning)|classification]] task, where the input is an image of an animal, and the correct output would be the name of the animal. Some input and output patterns can be easily learned by single-layer neural networks (i.e. [[perceptrons]]). However, these single-layer perceptrons cannot learn some relatively simple patterns, such as those that are not [[linearly separable]]. For example, a human may classify an image of an animal by recognizing certain features such as the number of limbs, the texture of the skin (whether it is furry, feathered, scaled, etc.), the size of the animal, and the list goes on. A single-layer neural network however, must learn a function that outputs a label solely using the intensity of the pixels in the image. There is no way for it to learn any abstract features of the input since it is limited to having only one layer. A multi-layered network overcomes this limitation as it can create internal representations and learn different features in each layer.<ref name=Rumelhart1986 /> The first layer may be responsible for learning the orientations of lines using the inputs from the individual pixels in the image. The second layer may combine the features learned in the first layer and learn to identify simple shapes such as circles. Each higher layer learns more and more abstract features such as those mentioned above that can be used to classify the image. Each layer finds patterns in the layer below it and it is this ability to create internal representations that are independent of outside input that gives multi-layered networks their power.
The goal and motivation for developing the backpropagation algorithm was to find a way to train a multi-layered neural network such that it can learn the appropriate internal representations to allow it to learn any arbitrary mapping of input to output.<ref name=Rumelhart1986 />
 
==SummaryOverview==
Backpropagation computes the gradient in [[parameter space|weight space]] of a feedforward neural network, with respect to a [[loss function]]. Denote:
* <math>x</math>: input (vector of features)
* <math>y</math>: target output
*:For classification, output will be a vector of class probabilities (e.g., <math>(0.1, 0.7, 0.2)</math>, and target output is a specific class, encoded by the [[one-hot]]/[[Dummy variable (statistics)|dummy variable]] (e.g., <math>(0, 1, 0)</math>).
* <math>C</math>: [[loss function]] or "cost function"{{efn|Use <math>C</math> for the loss function to allow <math>L</math> to be used for the number of layers}}
*:For classification, this is usually [[cross-entropy]] (XC, [[log loss]]), while for regression it is usually [[squared error loss]] (SEL).
* <math>L</math>: the number of layers
* <math>W^l = (w^l_{jk})</math>: the weights between layer <math>l - 1</math> and <math>l</math>, where <math>w^l_{jk}</math> is the weight between the <math>k</math>-th node in layer <math>l - 1</math> and the <math>j</math>-th node in layer <math>l</math>{{efn|This follows {{harvtxt|Nielsen|2015}}, and means (left) multiplication by the matrix <math>W^l</math> corresponds to converting output values of layer <math>l - 1</math> to input values of layer <math>l</math>: columns correspond to input coordinates, rows correspond to output coordinates.}}
* <math>f^l</math>: [[activation function]]s at layer <math>l</math>
*:For classification the last layer is usually the [[logistic function]] for binary classification, and [[softmax function|softmax]] (softargmax) for multi-class classification, while for the hidden layers this was traditionally a [[sigmoid function]] (logistic function or others) on each node (coordinate), but today is more varied, with [[Rectifier (neural networks)|rectifier]] ([[ramp function|ramp]], [[ReLU]]) being common.
* <math>a^l_j</math>: activation of the <math>j</math>-th node in layer <math>l</math>.
 
In the derivation of backpropagation, other intermediate quantities are used by introducing them as needed below. Bias terms are not treated specially since they correspond to a weight with a fixed input of 1. For backpropagation the specific loss function and activation functions do not matter as long as they and their derivatives can be evaluated efficiently. Traditional activation functions include sigmoid, [[tanh]], and [[Rectifier (neural networks)|ReLU]]. [[Swish function|Swish]],<ref>{{cite arXiv|last1=Ramachandran|first1=Prajit|last2=Zoph|first2=Barret|last3=Le|first3=Quoc V.|date=2017-10-27|title=Searching for Activation Functions|class=cs.NE|eprint=1710.05941}}</ref> [[Rectifier (neural networks)#Mish|mish]],<ref>{{cite arXiv|last=Misra|first=Diganta|date=2019-08-23|title=Mish: A Self Regularized Non-Monotonic Activation Function|class=cs.LG|eprint=1908.08681|language=en}}</ref> and many others.
The backpropagation learning algorithm can be divided into two phases: propagation and weight update.
 
The overall network is a combination of [[function composition]] and [[matrix multiplication]]:
=== Phase 1: Propagation ===
:<math>g(x) := f^L(W^L f^{L-1}(W^{L-1} \cdots f^1(W^1 x)\cdots))</math>
 
For a training set there will be a set of input–output pairs, <math>\left\{(x_i, y_i)\right\}</math>. For each input–output pair <math>(x_i, y_i)</math> in the training set, the loss of the model on that pair is the cost of the difference between the predicted output <math>g(x_i)</math> and the target output <math>y_i</math>:
Each propagation involves the following steps:
:<math>C(y_i, g(x_i))</math>
 
Note the distinction: during model evaluation the weights are fixed while the inputs vary (and the target output may be unknown), and the network ends with the output layer (it does not include the loss function). During model training the input–output pair is fixed while the weights vary, and the network ends with the loss function.
# Forward propagation of a training pattern's input through the neural network in order to generate the propagation's output activations.
# Backward propagation of the propagation's output activations through the neural network using the training pattern target in order to generate the deltas (the difference between the targeted and actual output values) of all output and hidden neurons.
 
Backpropagation computes the gradient for a ''fixed'' input–output pair <math>(x_i, y_i)</math>, where the weights <math>w^l_{jk}</math> can vary. Each individual component of the gradient, <math>\partial C/\partial w^l_{jk},</math> can be computed by the chain rule; but doing this separately for each weight is inefficient. Backpropagation efficiently computes the gradient by avoiding duplicate calculations and not computing unnecessary intermediate values, by computing the gradient of each layer – specifically the gradient of the weighted ''input'' of each layer, denoted by <math>\delta^l</math> – from back to front.
=== Phase 2: Weight update ===
 
Informally, the key point is that since the only way a weight in <math>W^l</math> affects the loss is through its effect on the ''next'' layer, and it does so ''linearly'', <math>\delta^l</math> are the only data you need to compute the gradients of the weights at layer <math>l</math>, and then the gradients of weights of previous layer can be computed by <math>\delta^{l-1}</math> and repeated recursively. This avoids inefficiency in two ways. First, it avoids duplication because when computing the gradient at layer <math>l</math>, it is unnecessary to recompute all derivatives on later layers <math>l+1, l+2, \ldots</math> each time. Second, it avoids unnecessary intermediate calculations, because at each stage it directly computes the gradient of the weights with respect to the ultimate output (the loss), rather than unnecessarily computing the derivatives of the values of hidden layers with respect to changes in weights <math>\partial a^{l'}_{j'}/\partial w^l_{jk}</math>.
For each weight-synapse follow the following steps:
# Multiply its output delta and input activation to get the gradient of the weight.
# Subtract a ratio (percentage) of the gradient from the weight.
This ratio (percentage) influences the speed and quality of learning; it is called the ''learning rate''. The greater the ratio, the faster the neuron trains; the lower the ratio, the more accurate the training is. The sign of the gradient of a weight indicates where the error is increasing, this is why the weight must be updated in the opposite direction.
 
Backpropagation can be expressed for simple feedforward networks in terms of [[#Matrix multiplication|matrix multiplication]], or more generally in terms of the [[#Adjoint graph|adjoint graph]].
Repeat phase 1 and 2 until the performance of the network is satisfactory.
 
==Matrix multiplication==
==Algorithm==
For the basic case of a feedforward network, where nodes in each layer are connected only to nodes in the immediate next layer (without skipping any layers), and there is a loss function that computes a scalar loss for the final output, backpropagation can be understood simply by matrix multiplication.{{efn|This section largely follows and summarizes {{harvtxt|Nielsen|2015}}.}} Essentially, backpropagation evaluates the expression for the derivative of the cost function as a product of derivatives between each layer ''from right to left'' – "backwards" – with the gradient of the weights between each layer being a simple modification of the partial products (the "backwards propagated error").
The following is a [[stochastic gradient descent]] algorithm for training a three-layer network (only one hidden layer):
 
Given an input–output pair <math>(x, y)</math>, the loss is:
initialize network weights (often small random values)
'''do'''
'''forEach''' training example ex
prediction = <u>neural-net-output</u>(network, ex) ''// forward pass''
actual = <u>teacher-output</u>(ex)
compute error (prediction - actual) at the output units
{{nowrap|compute <math>\Delta w_h</math> for all weights from hidden layer to output layer}} ''// backward pass''
{{nowrap|compute <math>\Delta w_i</math> for all weights from input layer to hidden layer}} ''// backward pass continued''
update network weights ''// input layer not modified by error estimate''
'''until''' all examples classified correctly or another stopping criterion satisfied
'''return''' the network
 
:<math>C(y, f^L(W^L f^{L-1}(W^{L-1} \cdots f^2(W^2 f^1(W^1 x))\cdots)))</math>
The lines labeled "backward pass" can be implemented using the backpropagation algorithm, which calculates the gradient of the error of the network regarding the network's modifiable weights.<ref>Paul J. Werbos (1994). The Roots of Backpropagation. From Ordered Derivatives to Neural Networks and Political Forecasting. New York, NY: John Wiley & Sons, Inc.</ref> Often the term "backpropagation" is used in a more general sense, to refer to the entire procedure encompassing both the calculation of the gradient and its use in stochastic gradient descent, but backpropagation proper can be used with any gradient-based optimizer, such as [[L-BFGS]] or [[Truncated Newton method|truncated Newton]].
 
To compute this, one starts with the input <math>x</math> and works forward; denote the weighted input of each hidden layer as <math>z^l</math> and the output of hidden layer <math>l</math> as the activation <math>a^l</math>. For backpropagation, the activation <math>a^l</math> as well as the derivatives <math>(f^l)'</math> (evaluated at <math>z^l</math>) must be cached for use during the backwards pass.
Backpropagation networks are necessarily [[multilayer perceptron]]s (usually with one input, multiple hidden, and one output layer). In order for the hidden layer to serve any useful function, multilayer networks must have non-linear activation functions for the multiple layers: a multilayer network using only linear activation functions is equivalent to some single layer, linear network. Non-linear activation functions that are commonly used include the [[Rectifier (neural networks)|rectifier]], [[logistic function]], the [[softmax activation function|softmax function]], and the [[gaussian function]].
 
The derivative of the loss in terms of the inputs is given by the chain rule; note that each term is a [[total derivative]], evaluated at the value of the network (at each node) on the input <math>x</math>:
The backpropagation algorithm for calculating a gradient has been rediscovered a number of times, and is a special case of a more general technique called [[automatic differentiation]] in the reverse accumulation mode.
 
:<math>\frac{d C}{d a^L}\cdot \frac{d a^L}{d z^L} \cdot \frac{d z^L}{d a^{L-1}} \cdot \frac{d a^{L-1}}{d z^{L-1}}\cdot \frac{d z^{L-1}}{d a^{L-2}} \cdot \ldots \cdot \frac{d a^1}{d z^1} \cdot \frac{\partial z^1}{\partial x},</math>
It is also closely related to the [[Gauss–Newton algorithm]], and is also part of continuing research in [[neural backpropagation]].
where <math>\frac{d a^L}{d z^L}</math> is a [[diagonal matrix]].
 
These terms are: the derivative of the loss function;{{efn|The derivative of the loss function is a [[covector]], since the loss function is a [[scalar-valued function]] of several variables.}} the derivatives of the activation functions;{{efn|The activation function is applied to each node separately, so the derivative is just the diagonal matrix of the derivative on each node. This is often represented as the [[Hadamard product (matrices)|Hadamard product]] with the vector of derivatives, denoted by <math>(f^l)'\odot</math>, which is mathematically identical but better matches the internal representation of the derivatives as a vector, rather than a diagonal matrix.}} and the matrices of weights:{{efn|Since matrix multiplication is linear, the derivative of multiplying by a matrix is just the matrix: <math>(Wx)' = W</math>.}}
:<math>\frac{d C}{d a^L}\circ (f^L)' \cdot W^L \circ (f^{L-1})' \cdot W^{L-1} \circ \cdots \circ (f^1)' \cdot W^1.</math>
 
The gradient <math>\nabla</math> is the [[transpose]] of the derivative of the output in terms of the input, so the matrices are transposed and the order of multiplication is reversed, but the entries are the same:
:<math>\nabla_x C = (W^1)^T \cdot (f^1)' \circ \ldots \circ (W^{L-1})^T \cdot (f^{L-1})' \circ (W^L)^T \cdot (f^L)' \circ \nabla_{a^L} C.</math>
 
Backpropagation then consists essentially of evaluating this expression from right to left (equivalently, multiplying the previous expression for the derivative from left to right), computing the gradient at each layer on the way; there is an added step, because the gradient of the weights is not just a subexpression: there's an extra multiplication.
 
Introducing the auxiliary quantity <math>\delta^l</math> for the partial products (multiplying from right to left), interpreted as the "error at level <math>l</math>" and defined as the gradient of the input values at level <math>l</math>:
:<math>\delta^l := (f^l)' \circ (W^{l+1})^T\cdot(f^{l+1})' \circ \cdots \circ (W^{L-1})^T \cdot (f^{L-1})' \circ (W^L)^T \cdot (f^L)' \circ \nabla_{a^L} C.</math>
Note that <math>\delta^l</math> is a vector, of length equal to the number of nodes in level <math>l</math>; each component is interpreted as the "cost attributable to (the value of) that node".
 
The gradient of the weights in layer <math>l</math> is then:
:<math>\nabla_{W^l} C = \delta^l(a^{l-1})^T.</math>
The factor of <math>a^{l-1}</math> is because the weights <math>W^l</math> between level <math>l - 1</math> and <math>l</math> affect level <math>l</math> proportionally to the inputs (activations): the inputs are fixed, the weights vary.
 
The <math>\delta^l</math> can easily be computed recursively, going from right to left, as:
:<math>\delta^{l-1} := (f^{l-1})' \circ (W^l)^T \cdot \delta^l.</math>
 
The gradients of the weights can thus be computed using a few matrix multiplications for each level; this is backpropagation.
 
Compared with naively computing forwards (using the <math>\delta^l</math> for illustration):
 
:<math>\begin{align}
\delta^1 &= (f^1)' \circ (W^2)^T \cdot (f^2)' \circ \cdots \circ (W^{L-1})^T \cdot (f^{L-1})' \circ (W^L)^T \cdot (f^L)' \circ \nabla_{a^L} C\\
\delta^2 &= (f^2)' \circ \cdots \circ (W^{L-1})^T \cdot (f^{L-1})' \circ (W^L)^T \cdot (f^L)' \circ \nabla_{a^L} C\\
&\vdots\\
\delta^{L-1} &= (f^{L-1})' \circ (W^L)^T \cdot (f^L)' \circ \nabla_{a^L} C\\
\delta^L &= (f^L)' \circ \nabla_{a^L} C,
\end{align}</math>
 
There are two key differences with backpropagation:
 
# Computing <math>\delta^{l-1}</math> in terms of <math>\delta^l</math> avoids the obvious duplicate multiplication of layers <math>l</math> and beyond.
# Multiplying starting from <math>\nabla_{a^L} C</math> – propagating the error ''backwards'' – means that each step simply multiplies a vector (<math>\delta^l</math>) by the matrices of weights <math>(W^l)^T</math> and derivatives of activations <math>(f^{l-1})'</math>. By contrast, multiplying forwards, starting from the changes at an earlier layer, means that each multiplication multiplies a ''matrix'' by a ''matrix''. This is much more expensive, and corresponds to tracking every possible path of a change in one layer <math>l</math> forward to changes in the layer <math>l+2</math> (for multiplying <math>W^{l+1}</math> by <math>W^{l+2}</math>, with additional multiplications for the derivatives of the activations), which unnecessarily computes the intermediate quantities of how weight changes affect the values of hidden nodes.
 
==Adjoint graph==
{{expand section|date=November 2019}}
For more general graphs, and other advanced variations, backpropagation can be understood in terms of [[automatic differentiation]], where backpropagation is a special case of [[reverse accumulation]] (or "reverse mode").<ref name="DL-reverse-mode" />
 
==Intuition==
 
===Motivation===
=== Learning as an optimization problem ===
The goal of any [[supervised learning]] algorithm is to find a function that best maps a set of inputs to their correct output. The motivation for backpropagation is to train a multi-layered neural network such that it can learn the appropriate internal representations to allow it to learn any arbitrary mapping of input to output.<ref name="RumelhartHintonWilliams1986a">{{cite journal |last1=Rumelhart |first1=David E. |author-link1=David E. Rumelhart |last2=Hinton |first2=Geoffrey E. |author-link2=Geoffrey E. Hinton |first3=Ronald J. |last3=Williams |author-link3=Ronald J. Williams |title=Learning representations by back-propagating errors|journal=Nature|date=1986a|volume=323|issue=6088|pages=533–536|doi=10.1038/323533a0|bibcode=1986Natur.323..533R|s2cid=205001834 }}</ref>
Before showing the mathematical derivation of the backpropagation algorithm, it helps to develop some intuitions about the relationship between the actual output of a neuron and the correct output for a particular training case. Consider a simple neural network with two input units, one output unit and no hidden units. Each neuron uses a [[Artificial neuron#Linear combination|linear output]]<ref group="note">One may notice that multi-layer neural networks use non-linear activation functions, so an example with linear neurons seems obscure. However, even though the error surface of multi-layer networks are much more complicated, locally they can be approximated by a paraboloid. Therefore, linear neurons are used for simplicity and easier understanding.</ref> that is the weighted sum of its input. [[File:A simple neural network with two input units and one output unit.png|thumb|250px|A simple neural network with two input units and one output unit]]
 
===Learning as an optimization problem===
To understand the mathematical derivation of the backpropagation algorithm, it helps to first develop some intuition about the relationship between the actual output of a neuron and the correct output for a particular training example. Consider a simple neural network with two input units, one output unit and no hidden units, and in which each neuron uses a [[Artificial neuron#Linear combination|linear output]] (unlike most work on neural networks, in which mapping from inputs to outputs is non-linear){{efn|One may notice that multi-layer neural networks use non-linear activation functions, so an example with linear neurons seems obscure. However, even though the error surface of multi-layer networks are much more complicated, locally they can be approximated by a paraboloid. Therefore, linear neurons are used for simplicity and easier understanding.}} that is the weighted sum of its input. [[File:A simple neural network with two input units and one output unit.png|thumb|250px|A simple neural network with two input units (each with a single input) and one output unit (with two inputs)]]
 
Initially, before training, the weights will be set randomly. Then the neuron learns from [[Training set|training examples]], which in this case consist of a set of [[tuple]]s <math>(x_1, x_2, t)</math> where <math>x_1</math> and <math>x_2</math> are the inputs to the network and {{mvar|t}} is the correct output (the output the network should produce given those inputs, when it has been trained). The initial network, given <math>x_1</math> and <math>x_2</math>, will compute an output {{mvar|y}} that likely differs from {{mvar|t}} (given random weights). A [[loss function]] <math> L(t, y) </math> is used for measuring the discrepancy between the target output {{mvar|t}} and the computed output {{mvar|y}}. For [[regression analysis]] problems the squared error can be used as a loss function, for [[Statistical classification|classification]] the [[cross-entropy|categorical cross-entropy]] can be used.
 
As an example consider a regression problem using the square error as a loss:
Initially, before training, the weights will be set randomly. Then the neuron learns from [[Training set|training examples]], which in this case consists of a set of tuples (<math>x_{1}</math>, <math>x_{2}</math>, <math>t</math>) where <math>x_{1}</math> and <math>x_{2}</math> are the inputs to the network and <math>t</math> is the correct output (the output the network should eventually produce given the identical inputs). The network given <math>x_{1}</math> and <math>x_{2}</math> will compute an output <math>y</math> which very likely differs from <math>t</math> (since the weights are initially random). A common method for measuring the discrepancy between the expected output <math>t</math> and the actual output <math>y</math> is using the squared error measure:
:<math>EL(t, y)= (t-y)^2 \= E, </math>,
where <math>E</math> is the discrepancy or error.
 
where {{mvar|E}} is the discrepancy or error.
As an example, consider the network on a single training case: <math>(1, 1, 0)</math>, thus the input <math>x_{1}</math> and <math>x_{2}</math> are 1 and 1 respectively and the correct output, <math>t</math> is 0. Now if the actual output <math>y</math> is plotted on the x-axis against the error <math>E</math> on the <math>y</math>-axis, the result is a parabola. The [[Maxima and minima|minimum]] of the [[parabola]] corresponds to the output <math>y</math> which minimizes the error <math>E</math>. For a single training case, the minimum also touches the <math>x</math>-axis, which means the error will be zero and the network can produce an output <math>y</math> that exactly matches the expected output <math>t</math>. Therefore, the problem of mapping inputs to outputs can be reduced to an [[optimization problem]] of finding a function that will produce the minimal error. [[File:Error surface of a linear neuron for a single training case.png|right|thumb|250px|Error surface of a linear neuron for a single training case.]]
Consider the network on a single training case: <math>(1, 1, 0)</math>. Thus, the input <math>x_1</math> and <math>x_2</math> are 1 and 1 respectively and the correct output, {{mvar|t}} is 0. Now if the relation is plotted between the network's output {{mvar|y}} on the horizontal axis and the error {{mvar|E}} on the vertical axis, the result is a parabola. The [[Maxima and minima|minimum]] of the [[parabola]] corresponds to the output {{mvar|y}} which minimizes the error {{mvar|E}}. For a single training case, the minimum also touches the horizontal axis, which means the error will be zero and the network can produce an output {{mvar|y}} that exactly matches the target output {{mvar|t}}. Therefore, the problem of mapping inputs to outputs can be reduced to an [[optimization problem]] of finding a function that will produce the minimal error. [[File:Error surface of a linear neuron for a single training case.png|right|thumb|250px|Error surface of a linear neuron for a single training case]]
 
However, the output of a neuron depends on the weighted sum of all its inputs:
:<math>y=x_1w_1 + x_2w_2</math>,
where <math>w_1</math> and <math>w_2</math> are the weights on the connection from the input units to the output unit. Therefore, the error also depends on the incoming weights to the neuron, which is ultimately what needs to be changed in the network to enable learning. If each weight is plotted on a separate horizontal axis and the error on the vertical axis, the result is a [[Paraboloid|parabolic bowl]] (If a neuron has <math>k</math> weights, then the [[Dimension (mathematics and physics)|dimension]] of the error surface would be <math>k+1</math>, thus a <math>k+1</math> dimensional equivalent of the 2D parabola).
[[File:Error surface of a linear neuron with two input weights.png|thumb|250px|Error surface of a linear neuron with two input weights]]
 
:<math>y=x_1w_1 + x_2w_2,</math>
The backpropagation algorithm aims to find the set of weights that minimizes the error. There are several methods for finding the minima of a parabola or any function in any dimension. One way is analytically by solving [[System of polynomial equations|systems of equations]], however this relies on the network being a [[linear system]], and the goal is to be able to also train multi-layer, [[Nonlinear system|non-linear]] networks (since a multi-layered linear network is equivalent to a single-layer network). The method used in backpropagation is [[gradient descent]].
 
where <math>w_1</math> and <math>w_2</math> are the weights on the connection from the input units to the output unit. Therefore, the error also depends on the incoming weights to the neuron, which is ultimately what needs to be changed in the network to enable learning.
=== An analogy for understanding gradient descent ===
{{Further|Gradient descent}}
The basic intuition behind [[gradient descent]] can be illustrated by a hypothetical scenario. A person is stuck in the mountains and is trying to get down (i.e. trying to find the minima). There is heavy fog such that visibility is extremely low. Therefore, the path down the mountain is not visible, so he must use local information to find the minima. He can use the method of gradient descent, which involves looking at the steepness of the hill at his current position, then proceeding in the direction with the steepest descent (i.e. downhill). If he was trying to find the top of the mountain (i.e. the maxima), then he would proceed in the direction steepest ascent (i.e. uphill). Using this method, he would eventually find his way down the mountain. However, assume also that the steepness of the hill is not immediately obvious with simple observation, but rather it requires a sophisticated instrument to measure, which the person happens to have at the moment. It takes quite some time to measure the steepness of the hill with the instrument, thus he should minimize his use of the instrument if he wanted to get down the mountain before sunset. The difficulty then is choosing the frequency at which he should measure the steepness of the hill so not to go off track.
 
In this example, upon injecting the training data <math>(1, 1, 0)</math>, the loss function becomes
In this analogy, the person represents the backpropagation algorithm, and the path taken down the mountain represents the sequence of parameter settings that the algorithm will explore. The steepness of the hill represents the [[slope]] of the error surface at that point. The instrument used to measure steepness is [[Differentiation (mathematics)|differentiation]] (the slope of the error surface can be calculated by taking the [[derivative]] of the squared error function at that point). The direction he chooses to travel in aligns with the [[gradient]] of the error surface at that point. The amount of time he travels before taking another measurement is the learning rate of the algorithm. See the [[backpropagation#Limitations|limitation section]] for a discussion of the limitations of this type of "hill climbing" algorithm.
 
<math> E = (t-y)^2 = y^2 = (x_1w_1 + x_2w_2)^2 = (w_1 + w_2)^2.</math>
 
Then, the loss function <math>E</math> takes the form of a parabolic cylinder with its base directed along <math>w_1 = -w_2</math>. Since all sets of weights that satisfy <math>w_1 = -w_2</math> minimize the loss function, in this case additional constraints are required to converge to a unique solution. Additional constraints could either be generated by setting specific conditions to the weights, or by injecting additional training data.
 
One commonly used algorithm to find the set of weights that minimizes the error is [[gradient descent]]. By backpropagation, the steepest descent direction is calculated of the loss function versus the present synaptic weights. Then, the weights can be modified along the steepest descent direction, and the error is minimized in an efficient way.
 
==Derivation==
Since backpropagation uses theThe gradient descent method, oneinvolves needs to calculatecalculating the derivative of the squared errorloss function with respect to the weights of the network. This is normally done using backpropagation. Assuming one output neuron,<ref group="note">{{efn|There can be multiple output neurons, in which case the error is the squared norm of the difference vector.</ref>}} the squared error function is:
 
: <math>E = \tfrac{1}{2}(t - y)^2</math>,
:<math>E = L(t, y)</math>
 
where
:<math>EL</math> is the squaredloss errorfor the output <math>y</math> and target value <math>t</math>,
:<math>t</math> is the target output for a training sample, and
:<math>y</math> is the actual output of the output neuron.
 
For each neuron <math>j</math>, its output <math>o_j</math> is defined as
The factor of <math>\textstyle\frac{1}{2}</math> is included to cancel the exponent when differentiating. Later, the expression will be multiplied with an arbitrary learning rate, so that it doesn't matter if a constant coefficient is introduced now.
 
:<math>o_j = \varphi(\text{net}_j) = \varphi\left(\sum_{k=1}^n w_{kj}x_k\right),</math>
For each neuron <math>j</math>, its output <math>o_{j}</math> is defined as
:<math>o_{j} = \varphi(\mbox{net}_{j}) = \varphi\left(\sum_{k=1}^{n}w_{kj}o_k\right)</math>.
 
where the [[activation function]] <math>\varphi</math> is [[non-linear]] and [[Differentiable function|differentiable]] over the activation region (the ReLU is not differentiable at one point). A historically used activation function is the [[logistic function]]:
The input <math>\mbox{net}_{j}</math> to a neuron is the weighted sum of outputs <math>o_k</math> of previous neurons. If the neuron is in the first layer after the input layer, the <math>o_k</math> of the input layer are simply the inputs <math>x_k</math> to the network. The number of input units to the neuron is <math>n</math>. The variable <math>w_{ij}</math> denotes the weight between neurons <math>i</math> and <math>j</math>.
 
:<math> \varphi(z) = \frac 1 {1+e^{-z}}</math>
The [[activation function]] <math>\varphi</math> is in general [[non-linear]] and [[differentiable]]. A commonly used activation function is the [[logistic function]]:
 
: <math> \varphi(z) = \frac{1}{1+e^{-z}}</math>
which has a nice[[Logistic function#Mathematical_properties|convenient]] derivative of:
 
: <math> \frac {d \varphi}{d z}(z) = \varphi(z)(1-\varphi(z)) </math>
:<math> \frac {d \varphi}{d z} = \varphi(z)(1-\varphi(z)) </math>
 
The input <math>\text{net}_j</math> to a neuron is the weighted sum of outputs <math>o_k</math> of previous neurons. If the neuron is in the first layer after the input layer, the <math>o_k</math> of the input layer are simply the inputs <math>x_k</math> to the network. The number of input units to the neuron is <math>n</math>. The variable <math>w_{kj}</math> denotes the weight between neuron <math>k</math> of the previous layer and neuron <math>j</math> of the current layer.
 
===Finding the derivative of the error===
[[Image:ArtificialNeuronModel english.png|thumb|400px|Diagram of an artificial neural network to illustrate the notation used here]]
 
Calculating the [[partial derivative]] of the error with respect to a weight <math>w_{ij}</math> is done using the [[chain rule]] twice:
{{NumBlk|: |<math>\frac{\partial E}{\partial w_{ij}} = \frac{\partial E}{\partial o_j} \frac{\partial o_j}{\partial\mathrmo_{net_jj}} \frac{\partial \mathrmo_{net_jj}}{\partial w_{ij}}</math>
= \frac{\partial E}{\partial o_j} \frac{\partial o_j}{\partial\text{net}_j} \frac{\partial \text{net}_j}{\partial w_{ij}}</math>|{{EquationRef|Eq. 1}}}}
In the last factor of the right-hand side of the above, only one term in the sum <math>\text{net}_j</math> depends on <math>w_{ij}</math>, so that
{{NumBlk|:|<math>\frac{\partial \text{net}_j}{\partial w_{ij}} = \frac{\partial}{\partial w_{ij}} \left(\sum_{k=1}^n w_{kj} o_k\right) = \frac{\partial}{\partial w_{ij}} w_{ij} o_i= o_i.</math>|{{EquationRef|Eq. 2}}}}
 
InIf the lastneuron termis ofin the right-handfirst sidelayer ofafter the followinginput layer, only one term in the sum <math>\mathrm{net_j}o_i</math> dependsis onjust <math>w_{ij}x_i</math>, so that .
: <math>\frac{\partial \mathrm{net_j}}{\partial w_{ij}} = \frac{\partial}{\partial w_{ij}}\left(\sum_{k=1}^{n}w_{kj}o_k\right) = o_i</math>.
 
If the neuron is in the first layer after the input layer, <math>o_i</math> is just <math>x_i</math>. The derivative of the output of neuron <math>j</math> with respect to its input is simply the partial derivative of the activation function (assuming here that the logistic function is used):
 
: <math>\frac{\partial o_j}{\partial\mathrm{net_j}} = \frac {\partial}{\partial \mathrm{net_j}}\varphi(\mathrm{net_j}) = \varphi(\mathrm{net_j})(1-\varphi(\mathrm{net_j}))</math>
{{NumBlk|:|<math>\frac{\partial o_j}{\partial\text{net}_j} = \frac {\partial \varphi(\text{net}_j)}{\partial \text{net}_j}</math>|{{EquationRef|Eq. 3}}}}
This is the reason why backpropagation requires the activation function to be [[differentiable]].
 
which for the [[logistic function|logistic activation function]]
:<math>\frac{\partial o_j}{\partial\text{net}_j} = \frac {\partial}{\partial \text{net}_j} \varphi(\text{net}_j) = \varphi(\text{net}_j)(1-\varphi(\text{net}_j)) = o_j(1-o_j)</math>
 
This is the reason why backpropagation requires that the activation function be [[Differentiable function|differentiable]]. (Nevertheless, the [[ReLU]] activation function, which is non-differentiable at 0, has become quite popular, e.g. in [[AlexNet]])
 
The first factor is straightforward to evaluate if the neuron is in the output layer, because then <math>o_j = y</math> and
{{NumBlk|:|<math>\frac{\partial E}{\partial o_j} = \frac{\partial E}{\partial y} </math>|{{EquationRef|Eq. 4}}}}
 
If half of the square error is used as loss function we can rewrite it as
 
The first term is straightforward to evaluate if the neuron is in the output layer, because then <math>o_j = y</math> and
: <math>\frac{\partial E}{\partial o_j} = \frac{\partial E}{\partial y} = \frac{\partial}{\partial y} \frac{1}{2}(t - y)^2 = y - t </math>
 
However, if <math>j</math> is in an arbitrary inner layer of the network, finding the derivative <math>E</math> with respect to <math>o_j</math> is less obvious.
 
Considering <math>E</math> as a function ofwith the inputs ofbeing all neurons <math>L = \{u, v, \dots, w\}</math> receiving input from neuron <math>j</math>,
 
: <math>\frac{\partial E(o_j)}{\partial o_j} = \frac{\partial E(\mathrm{net}_u, \mathrm{net}_v, \dots, \mathrm{net}_w)}{\partial o_j}</math>
: <math>\frac{\partial E(o_j)}{\partial o_j} = \frac{\partial E(\mathrm{net}_u, \text{net}_v, \dots, \mathrm{net}_w)}{\partial o_j}</math>
 
and taking the [[total derivative]] with respect to <math>o_j</math>, a recursive expression for the derivative is obtained:
: <math>\frac{\partial E}{\partial o_j} = \sum_{l \in L} \left(\frac{\partial E}{\partial \mathrm{net}_l}\frac{\partial \mathrm{net}_l}{\partial o_j}\right) = \sum_{l \in L} \left(\frac{\partial E}{\partial o_{l}}\frac{\partial o_{l}}{\partial \mathrm{net}_l}w_{jl}\right)</math>
 
{{NumBlk|:|<math>\frac{\partial E}{\partial o_j} = \sum_{\ell \in L} \left(\frac{\partial E}{\partial \text{net}_\ell}\frac{\partial \text{net}_\ell}{\partial o_j}\right) = \sum_{\ell \in L} \left(\frac{\partial E}{\partial o_\ell}\frac{\partial o_\ell}{\partial \text{net}_\ell}\frac{\partial \text{net}_\ell}{\partial o_j}\right) = \sum_{\ell \in L} \left(\frac{\partial E}{\partial o_\ell}\frac{\partial o_\ell}{\partial \text{net}_\ell}w_{j \ell}\right)</math>|{{EquationRef|Eq. 5}}}}
Therefore, the derivative with respect to <math>o_j</math> can be calculated if all the derivatives with respect to the outputs <math>o_l</math> of the next layer – the one closer to the output neuron – are known.
 
Therefore, the derivative with respect to <math>o_j</math> can be calculated if all the derivatives with respect to the outputs <math>o_\ell</math> of the next layer – the ones closer to the output neuron – are known. [Note, if any of the neurons in set <math>L</math> were not connected to neuron <math>j</math>, they would be independent of <math>w_{ij}</math> and the corresponding partial derivative under the summation would vanish to 0.]
Putting it all together:
 
Substituting {{EquationNote|Eq. 2}}, {{EquationNote|Eq. 3}} {{EquationNote|Eq.4}} and {{EquationNote|Eq. 5}} in {{EquationNote|Eq. 1}} we obtain:
:<math>\dfrac{\partial E}{\partial w_{ij}} = \delta_{j} o_{i}</math>
 
: <math>\frac{\partial E}{\partial w_{ij}}
= \frac{\partial E}{\partial o_{j}} \frac{\partial o_{j}}{\partial \text{net}_{j}} \frac{\partial \text{net}_{j}}{\partial w_{ij}}
 
= \frac{\partial E}{\partial o_{j}} \frac{\partial o_{j}}{\partial \text{net}_{j}} o_i</math>
: <math> \frac{\partial E}{\partial w_{ij}} = o_i \delta_j</math>
 
with
 
:<math>\delta_j
:<math>\delta_{j} = \frac{\partial E}{\partial o_j} \frac{\partial o_j}{\partial\mathrm{net_j}} = \begin{cases}
=
(o_{j}-t_{j})o_{j}(1-o_{j}) & \mbox{if } j \mbox{ is an output neuron,}\\
\frac{\partial E}{\partial o_j} \frac{\partial o_j}{\partial\text{net}_j}
(\sum_{l\in L} \delta_{l} w_{jl})o_{j}(1-o_{j}) & \mbox{if } j \mbox{ is an inner neuron.}
= \begin{cases}
\frac{\partial L(t, o_j)}{\partial o_j} \frac {d \varphi(\text{net}_j)}{d \text{net}_j} & \text{if } j \text{ is an output neuron,}\\
(\sum_{\ell\in L} w_{j \ell}
\delta_\ell)\frac {d \varphi(\text{net}_j)}{d \text{net}_j} & \text{if } j \text{ is an inner neuron.}
\end{cases}</math>
 
if <math>\varphi</math> is the logistic function, and the error is the square error:
To update the weight <math>w_{ij}</math> using gradient descent, one must choose a learning rate, <math>\alpha</math>. The change in weight, which is added to the old weight, is equal to the product of the learning rate and the gradient, multiplied by <math>-1</math>:
: <math> \Delta w_{ij} = - \alpha \frac{\partial E}{\partial w_{ij}} </math>
 
: <math>\delta_j = \frac{\partial E}{\partial o_j} \frac{\partial o_j}{\partial\text{net}_j} = \begin{cases}
The <math>\textstyle -1</math> is required in order to update in the direction of a minimum, not a maximum, of the error function.
(o_j-t_j)o_j(1-o_{j}) & \text{if } j \text{ is an output neuron,}\\
(\sum_{\ell\in L} w_{j \ell} \delta_\ell)o_j(1-o_j) & \text{if } j \text{ is an inner neuron.}
\end{cases}</math>
 
To update the weight <math>w_{ij}</math> using gradient descent, one must choose a learning rate, <math>\eta >0</math>. The change in weight needs to reflect the impact on <math>E</math> of an increase or decrease in <math>w_{ij}</math>. If <math>\frac{\partial E}{\partial w_{ij}} > 0</math>, an increase in <math>w_{ij}</math> increases <math>E</math>; conversely, if <math>\frac{\partial E}{\partial w_{ij}} < 0</math>, an increase in <math>w_{ij}</math> decreases <math>E</math>. The new <math>\Delta w_{ij}</math> is added to the old weight, and the product of the learning rate and the gradient, multiplied by <math>-1</math> guarantees that <math>w_{ij}</math> changes in a way that always decreases <math>E</math>. In other words, in the equation immediately below, <math>- \eta \frac{\partial E}{\partial w_{ij}}</math> always changes <math>w_{ij}</math> in such a way that <math>E</math> is decreased:
For a single-layer network, this expression becomes the [[Delta Rule]].
To better understand how backpropagation works, here is an example to illustrate it: [https://web.archive.org/web/20150317210621/https://www4.rgu.ac.uk/files/chapter3%20-%20bp.pdf The Back Propagation Algorithm], page 20.
 
: <math> \Delta w_{ij} = - \eta \frac{\partial E}{\partial w_{ij}} = - \eta o_i \delta_j</math>
== Modes of learning ==
 
==Second-order gradient descent==
There are three modes of learning to choose from: [[online machine learning|on-line]], batch and [[stochastic gradient descent|stochastic]]. In on-line and stochastic learning, each propagation is followed immediately by a weight update. In batch learning, many propagations occur before updating the weights. On-line learning is used for dynamic environments that provide a continuous stream of new patterns. Stochastic learning and batch learning both make use of a training set of static patterns. Stochastic learning introduces "noise" into the gradient descent process, using the local gradient calculated from one data point to approximate the local gradient calculated on the whole batch. This reduces its chances of getting stuck in local minima. Yet batch learning will yield a much more stable descent to a local minimum since each update is performed based on all patterns. In modern applications a common compromise choice is to use "mini-batches", meaning stochastic learning but with more than just one data point.
{{Anchor|Second order|Hessian}}
 
Using a [[Hessian matrix]] of second-order derivatives of the error function, the [[Levenberg–Marquardt algorithm]] often converges faster than first-order gradient descent, especially when the topology of the error function is complicated.<ref name="Tan2018">{{cite journal|last1=Tan|first1=Hong Hui|last2=Lim|first2=King Han|title=Review of second-order optimization techniques in artificial neural networks backpropagation|journal=IOP Conference Series: Materials Science and Engineering|year=2019|volume=495|issue=1|page=012003|doi=10.1088/1757-899X/495/1/012003|bibcode=2019MS&E..495a2003T|s2cid=208124487|doi-access=free}}</ref><ref name="Wiliamowski2010">{{cite journal|title=Improved Computation for Levenberg–Marquardt Training|last1=Wiliamowski|first1=Bogdan|last2=Yu|first2=Hao|journal=IEEE Transactions on Neural Networks and Learning Systems|volume=21|issue=6|date=June 2010|url=https://www.eng.auburn.edu/~wilambm/pap/2010/Improved%20Computation%20for%20LM%20Training.pdf}}</ref> It may also find solutions in smaller node counts for which other methods might not converge.<ref name="Wiliamowski2010" /> The Hessian can be approximated by the [[Fisher information]] matrix.<ref name="Martens2020">{{cite journal|last=Martens|first=James|title=New Insights and Perspectives on the Natural Gradient Method|journal=Journal of Machine Learning Research|issue=21|date=August 2020|arxiv=1412.1193}}</ref>
 
As an example, consider a simple feedforward network. At the <math>l</math>-th layer, we have<math display="block">x^{(l)}_i, \quad a^{(l)}_i = f(x^{(l)}_i), \quad x^{(l+1)}_i = \sum_j W_{ij} a^{(l)}_j</math>where <math>x</math> are the pre-activations, <math>a</math> are the activations, and <math>W</math> is the weight matrix. Given a loss function <math>L</math>, the first-order backpropagation states that<math display="block">\frac{\partial L}{\partial a_j^{(l)}} = \sum_j W_{ij}\frac{\partial L}{\partial x_i^{(l+1)}}, \quad
\frac{\partial L}{\partial x_j^{(l)}} = f'(x_j^{(l)})\frac{\partial L}{\partial a_j^{(l)}}</math>and the second-order backpropagation states that<math display="block">\frac{\partial^2 L}{\partial a_{j_1}^{(l)}\partial a_{j_2}^{(l)}} = \sum_{j_1j_2} W_{i_1j_1}W_{i_2j_2}\frac{\partial^2 L}{\partial x_{i_1}^{(l+1)}\partial x_{i_2}^{(l+1)}}, \quad
\frac{\partial^2 L}{\partial x_{j_1}^{(l)}\partial x_{j_2}^{(l)}} = f'(x_{j_1}^{(l)}) f'(x_{j_2}^{(l)}) \frac{\partial^2 L}{\partial a_{j_1}^{(l)}\partial a_{j_2}^{(l)}} + \delta_{j_1 j_2} f''(x^{(l)}_{j_1} ) \frac{\partial L}{\partial a_{j_1}^{(l)}}</math>where <math>\delta</math> is the [[Dirac delta function|Dirac delta symbol]].
 
Arbitrary-order derivatives in arbitrary computational graphs can be computed with backpropagation, but with more complex expressions for higher orders.
 
==Loss function==
{{Further|Loss function}}
The loss function is a function that maps values of one or more variables onto a [[real number]] intuitively representing some "cost" associated with those values. For backpropagation, the loss function calculates the difference between the network output and its expected output, after a training example has propagated through the network.
 
===Assumptions===
The mathematical expression of the loss function must fulfill two conditions in order for it to be possibly used in backpropagation.<ref>{{harvtxt|Nielsen|2015}}, "[W]hat assumptions do we need to make about our cost function ... in order that backpropagation can be applied? The first assumption we need is that the cost function can be written as an average ... over cost functions ... for individual training examples ... The second assumption we make about the cost is that it can be written as a function of the outputs from the neural network ..."</ref> The first is that it can be written as an average <math display="inline">E=\frac{1}{n}\sum_xE_x</math> over error functions <math display="inline">E_x</math>, for <math display="inline">n</math> individual training examples, <math display="inline">x</math>. The reason for this assumption is that the backpropagation algorithm calculates the gradient of the error function for a single training example, which needs to be generalized to the overall error function. The second assumption is that it can be written as a function of the outputs from the neural network.
 
===Example loss function===
Let <math>y,y'</math> be vectors in <math>\mathbb{R}^n</math>.
 
Select an error function <math>E(y,y')</math> measuring the difference between two outputs. The standard choice is the square of the [[Euclidean distance]] between the vectors <math>y</math> and <math>y'</math>:<math display="block">E(y,y') = \tfrac{1}{2} \lVert y-y'\rVert^2</math>The error function over <math display="inline">n</math> training examples can then be written as an average of losses over individual examples:<math display="block">E=\frac{1}{2n}\sum_x\lVert (y(x)-y'(x)) \rVert^2</math>
 
==Limitations==
[[File:Extrema example.svg|thumb|250px|Gradient descent canmay find thea local minimum instead of the global minimum.]]
* Gradient descent with backpropagation is not guaranteed to find the [[Maxima and minima|global minimum]] of the error function, but only a local minimum; also, it has trouble crossing [[Plateau (mathematics)|plateaus]] in the error function landscape. This issue, caused by the [[Convex optimization|non-convexity]] of error functions in neural networks, was long thought to be a major drawback, but in a 2015 review article, [[Yann LeCun]] ''et al.'' argue that in many practical problems, it isn'tis not.<ref>{{cite journal |first1=Yann |last1=LeCun|author-link1=Yann LeCun |first2=Yoshua |last2=Bengio |first3=Geoffrey |last3=Hinton |title=Deep learning |journal=Nature |volume=521 |issue=7553 |year=2015 |pages=436–444 |doi=10.1038/nature14539 |pmid=26017442|bibcode=2015Natur.521..436L |s2cid=3074096 |url=https://hal.science/hal-04206682/file/Lecun2015.pdf }}</ref>
* Backpropagation learning does not require normalization of input vectors; however, normalization could improve performance.<ref>ISBN{{Cite book|title=AI Techniques for Game Programming|last1=Buckland|first1=Matt|last2=Collins|first2=Mark |___location=Boston |publisher=Premier Press |year=2002 |isbn=1-931841-08-X, }}</ref>
* Backpropagation requires the derivatives of activation functions to be known at network design time.
 
== History ==
{{See also|Perceptron#History|label 1=History of perceptron}}
 
=== Precursors ===
{{See also|Perceptron#History|label 1=History of Perceptron}}
Backpropagation had been derived repeatedly, as it is essentially an efficient application of the [[chain rule]] (first written down by [[Gottfried Wilhelm Leibniz]] in 1676)<ref name="leibniz1676">{{Cite book |last=Leibniz |first=Gottfried Wilhelm Freiherr von |authorlink=Gottfried Wilhelm Leibniz|url=https://books.google.com/books?id=bOIGAAAAYAAJ&q=leibniz+altered+manuscripts&pg=PA90 |title=The Early Mathematical Manuscripts of Leibniz: Translated from the Latin Texts Published by Carl Immanuel Gerhardt with Critical and Historical Notes (Leibniz published the chain rule in a 1676 memoir) |date=1920 |publisher=Open court publishing Company |isbn=9780598818461 |language=en}}</ref><ref>{{cite journal |last1=Rodríguez |first1=Omar Hernández |last2=López Fernández |first2=Jorge M. |year=2010 |title=A Semiotic Reflection on the Didactics of the Chain Rule |url=https://scholarworks.umt.edu/tme/vol7/iss2/10/ |journal=The Mathematics Enthusiast |volume=7 |issue=2 |pages=321–332 |doi=10.54870/1551-3440.1191 |s2cid=29739148 |access-date=2019-08-04 |doi-access=free}}</ref> to neural networks.
 
The terminology "back-propagating error correction" was introduced in 1962 by [[Frank Rosenblatt]], but he did not know how to implement this.<ref>{{cite book |last=Rosenblatt |first=Frank |title=Principles of Neurodynamics |publisher=Spartan, New York |year=1962 |pages=287–298 |author-link=Frank Rosenblatt}}</ref> In any case, he only studied neurons whose outputs were discrete levels, which only had zero derivatives, making backpropagation impossible.
According to various sources,<ref name="dreyfus1990">[[Stuart Dreyfus]] (1990). Artificial Neural Networks, Back Propagation and the Kelley-Bryson Gradient Procedure. J. Guidance, Control and Dynamics, 1990. </ref><ref name="mizutani2000">Eiji Mizutani, [[Stuart Dreyfus]], Kenichi Nishio (2000). On derivation of MLP backpropagation from the Kelley-Bryson optimal-control gradient formula and its application. Proceedings of the IEEE International Joint Conference on Neural Networks (IJCNN 2000), Como Italy, July 2000. [http://queue.ieor.berkeley.edu/People/Faculty/dreyfus-pubs/ijcnn2k.pdf Online] </ref><ref name="schmidhuber2015">[[Jürgen Schmidhuber]] (2015). Deep learning in neural networks: An overview. Neural Networks 61 (2015): 85-117. [http://arxiv.org/abs/1404.7828 ArXiv] </ref><ref name="scholarpedia2015">[[Jürgen Schmidhuber]] (2015). Deep Learning. Scholarpedia, 10(11):32832. [http://www.scholarpedia.org/article/Deep_Learning#Backpropagation Section on Backpropagation]</ref>
basics of continuous backpropagation were derived in the context of [[control theory]] by [[Henry J. Kelley]]<ref name="kelley1960">[[Henry J. Kelley]] (1960). Gradient theory of optimal flight paths. Ars Journal, 30(10), 947-954. [http://arc.aiaa.org/doi/abs/10.2514/8.5282?journalCode=arsj Online]</ref> in 1960 and by [[Arthur E. Bryson]] in 1961,<ref name="bryson1961">[[Arthur E. Bryson]] (1961, April). A gradient method for optimizing multi-stage allocation processes. In Proceedings of the Harvard Univ. Symposium on digital computers and their applications.</ref> using principles of [[dynamic programming]]. In 1962, [[Stuart Dreyfus]] published a simpler derivation based only on the [[chain rule]].<ref name="dreyfus1962">[[Stuart Dreyfus]] (1962). The numerical solution of variational problems. Journal of Mathematical Analysis and Applications, 5(1), 30-45. [https://www.researchgate.net/publication/256244271_The_numerical_solution_of_variational_problems Online]</ref> [[Vapnik]] cites reference<ref>Bryson, A.E.; W.F. Denham; S.E. Dreyfus. Optimal programming problems with inequality constraints. I: Necessary conditions for extremal solutions. AIAA J. 1, 11 (1963) 2544-2550</ref> in his book on [[Support Vector Machines]]. [[Arthur E. Bryson]] and [[Yu-Chi Ho]] described it as a multi-stage dynamic system optimization method in 1969.<ref>{{cite book|title=Artificial Intelligence A Modern Approach|author1=[[Stuart J. Russell|Stuart Russell]]|author2=[[Peter Norvig]]|quote=The most popular method for learning in multilayer networks is called Back-propagation. |page=578}}</ref><ref>{{cite book|title=Applied optimal control: optimization, estimation, and control|authors=Arthur Earl Bryson, Yu-Chi Ho|year=1969|pages=481|publisher=Blaisdell Publishing Company or Xerox College Publishing}}</ref>
 
Precursors to backpropagation appeared in [[Optimal control|optimal control theory]] since 1950s. [[Yann LeCun]] et al credits 1950s work by [[Lev Pontryagin|Pontryagin]] and others in optimal control theory, especially the [[adjoint state method]], for being a continuous-time version of backpropagation.<ref>LeCun, Yann, et al. "A theoretical framework for back-propagation." ''Proceedings of the 1988 connectionist models summer school''. Vol. 1. 1988.</ref> [[Robert Hecht-Nielsen|Hecht-Nielsen]]<ref>{{Cite book |last=Hecht-Nielsen |first=Robert |url=http://archive.org/details/neurocomputing0000hech |title=Neurocomputing |date=1990 |publisher=Reading, Mass. : Addison-Wesley Pub. Co. |others=Internet Archive |isbn=978-0-201-09355-1 |pages=124–125}}</ref> credits the [[Stochastic approximation|Robbins–Monro algorithm]] (1951)<ref name="robbins1951">{{Cite journal |last1=Robbins |first1=H. |author-link=Herbert Robbins |last2=Monro |first2=S. |year=1951 |title=A Stochastic Approximation Method |journal=The Annals of Mathematical Statistics |volume=22 |issue=3 |pages=400 |doi=10.1214/aoms/1177729586 |doi-access=free}}</ref> and [[Arthur E. Bryson|Arthur Bryson]] and [[Yu-Chi Ho]]'s ''Applied Optimal Control'' (1969) as presages of backpropagation. Other precursors were [[Henry J. Kelley]] 1960,<ref name="kelley1960" /> and [[Arthur E. Bryson]] (1961).<ref name="bryson1961" /> In 1962, [[Stuart Dreyfus]] published a simpler derivation based only on the [[chain rule]].<ref>{{Cite journal |last=Dreyfus |first=Stuart |year=1962 |title=The numerical solution of variational problems |journal=Journal of Mathematical Analysis and Applications |volume=5 |issue=1 |pages=30–45 |doi=10.1016/0022-247x(62)90004-5 |doi-access=free}}</ref><ref name="dreyfus1990">{{Cite journal |last=Dreyfus |first=Stuart E. |author-link=Stuart Dreyfus |date=1990 |title=Artificial Neural Networks, Back Propagation, and the Kelley-Bryson Gradient Procedure |journal=Journal of Guidance, Control, and Dynamics |volume=13 |issue=5 |pages=926–928 |bibcode=1990JGCD...13..926D |doi=10.2514/3.25422}}</ref><ref>{{Cite web |last1=Mizutani |first1=Eiji |last2=Dreyfus |first2=Stuart |last3=Nishio |first3=Kenichi |date=July 2000 |title=On derivation of MLP backpropagation from the Kelley-Bryson optimal-control gradient formula and its application |url=https://coeieor.wpengine.com/wp-content/uploads/2019/03/ijcnn2k.pdf |publisher=Proceedings of the IEEE International Joint Conference on Neural Networks}}</ref> In 1973, he adapted [[parameter]]s of controllers in proportion to error gradients.<ref name="dreyfus1973">{{cite journal |last=Dreyfus |first=Stuart |author-link=Stuart Dreyfus |year=1973 |title=The computational solution of optimal control problems with time lag |journal=IEEE Transactions on Automatic Control |volume=18 |issue=4 |pages=383–385 |doi=10.1109/tac.1973.1100330}}</ref> Unlike modern backpropagation, these precursors used standard Jacobian matrix calculations from one stage to the previous one, neither addressing direct links across several stages nor potential additional efficiency gains due to network sparsity.<ref name="DLhistory">{{cite arXiv |eprint=2212.11279 |class=cs.NE |first=Jürgen |last=Schmidhuber |author-link=Jürgen Schmidhuber |title=Annotated History of Modern AI and Deep Learning |date=2022}}</ref>
In 1970, [[Seppo Linnainmaa]] finally published the general method for [[automatic differentiation]] (AD) of discrete connected networks of nested [[differentiable]] functions.<ref name="lin1970">[[Seppo Linnainmaa]] (1970). The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors. Master's Thesis (in Finnish), Univ. Helsinki, 6-7.</ref><ref name="lin1976">[[Seppo Linnainmaa]] (1976). Taylor expansion of the accumulated rounding error. BIT Numerical Mathematics, 16(2), 146-160.</ref> This corresponds to the modern version of backpropagation which is efficient even when the networks are sparse.<ref name="grie2012">Griewank, Andreas (2012). Who Invented the Reverse Mode of Differentiation?. Optimization Stories, Documenta Matematica, Extra Volume ISMP (2012), 389-400.</ref><ref name="grie2008">Griewank, Andreas and Walther, A.. Principles and Techniques of Algorithmic Differentiation, Second Edition. SIAM, 2008.</ref><ref name="schmidhuber2015"/><ref name="scholarpedia2015"/>
 
The [[ADALINE]] (1960) learning algorithm was gradient descent with a squared error loss for a single layer. The first [[multilayer perceptron]] (MLP) with more than one layer trained by [[stochastic gradient descent]]<ref name="robbins1951" /> was published in 1967 by [[Shun'ichi Amari]].<ref name="Amari1967">{{cite journal |last1=Amari |first1=Shun'ichi |author-link=Shun'ichi Amari |date=1967 |title=A theory of adaptive pattern classifier |journal=IEEE Transactions |volume=EC |issue=16 |pages=279–307}}</ref> The MLP had 5 layers, with 2 learnable layers, and it learned to classify patterns not linearly separable.<ref name="DLhistory" />
In 1973, [[Stuart Dreyfus]] used backpropagation to adapt [[parameter]]s of controllers in proportion to error gradients.<ref name="dreyfus1973">[[Stuart Dreyfus]] (1973). The computational solution of optimal control problems with time lag. IEEE Transactions on Automatic Control, 18(4):383–385.</ref> In 1974, [[Paul Werbos]] mentioned the possibility of applying this principle to [[artificial neural networks]],<ref name="werbos1974">[[Paul Werbos]] (1974). Beyond regression: New tools for prediction and analysis in the behavioral sciences. PhD thesis, Harvard University.</ref> and in 1982, he applied Linnainmaa's AD method to neural networks in the way that is widely used today.<ref name="werbos1982">[[Paul Werbos]] (1982). Applications of advances in nonlinear sensitivity analysis. In System modeling and optimization (pp. 762-770). Springer Berlin Heidelberg. [http://werbos.com/Neural/SensitivityIFIPSeptember1981.pdf Online]</ref><ref name="scholarpedia2015"/>
 
=== Modern backpropagation ===
In 1986, [[David E. Rumelhart]], [[Geoffrey E. Hinton]] and [[Ronald J. Williams]] showed through computer experiments that this method can generate useful internal representations of incoming data in hidden layers of neural networks.<ref name=Rumelhart1986>{{cite journal|last=Rumelhart|first=David E.|author2=Hinton, Geoffrey E.|author3=Williams, Ronald J.|title=Learning representations by back-propagating errors|journal=Nature|date=8 October 1986|volume=323|issue=6088|pages=533–536|doi=10.1038/323533a0}}</ref>
Modern backpropagation was first published by [[Seppo Linnainmaa]] as "reverse mode of [[automatic differentiation]]" (1970)<ref name="lin1970">{{cite thesis |first=Seppo |last=Linnainmaa |author-link=Seppo Linnainmaa |year=1970 |type=Masters |title=The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors |language=fi |publisher=University of Helsinki |pages=6–7}}</ref> for discrete connected networks of nested [[Differentiable function|differentiable]] functions.<ref name="lin1976">{{cite journal |last1=Linnainmaa |first1=Seppo |author-link=Seppo Linnainmaa |year=1976 |title=Taylor expansion of the accumulated rounding error |journal=BIT Numerical Mathematics |volume=16 |issue=2 |pages=146–160 |doi=10.1007/bf01931367 |s2cid=122357351}}</ref><ref name="grie2012">{{cite book |last=Griewank |first=Andreas |title=Optimization Stories |year=2012 |series=Documenta Mathematica, Extra Volume ISMP |pages=389–400 |chapter=Who Invented the Reverse Mode of Differentiation? |s2cid=15568746}}</ref><ref name="grie2008">{{cite book |last1=Griewank |first1=Andreas |url={{google books |plainurl=y |id=xoiiLaRxcbEC}} |title=Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, Second Edition |last2=Walther |first2=Andrea |author2-link=Andrea Walther |publisher=SIAM |year=2008 |isbn=978-0-89871-776-1}}</ref>
<ref name=Alpaydin2010>{{cite book|last=Alpaydın|first=Ethem|title=Introduction to machine learning|year=2010|publisher=MIT Press|___location=Cambridge, Mass.|isbn=978-0-262-01243-0|edition=2nd|page=250}}</ref> In 1993, Eric A. Wan was the first<ref name="schmidhuber2015"/> to win an international pattern recognition contest through backpropagation.<ref name="wan1993">Eric A. Wan (1993). Time series prediction by using a connectionist network with internal delay lines. In SANTA FE INSTITUTE STUDIES IN THE SCIENCES OF COMPLEXITY-PROCEEDINGS (Vol. 15, pp. 195-195). Addison-Wesley Publishing Co.</ref>
During the 2000s it fell out of favour but has returned again in the 2010s, now able to train much larger networks using huge modern computing power such as [[GPU]]s. For example, in 2013 top speech recognisers now use backpropagation-trained neural networks.{{citation needed|date=September 2015}}
 
In 1982, [[Paul Werbos]] applied backpropagation to MLPs in the way that has become standard.<ref name="werbos1982">{{Cite book|title=System modeling and optimization|last=Werbos|first=Paul|publisher=Springer|year=1982|pages=762–770|chapter=Applications of advances in nonlinear sensitivity analysis|author-link=Paul Werbos|chapter-url=http://werbos.com/Neural/SensitivityIFIPSeptember1981.pdf|access-date=2 July 2017|archive-date=14 April 2016|archive-url=https://web.archive.org/web/20160414055503/http://werbos.com/Neural/SensitivityIFIPSeptember1981.pdf|url-status=live}}</ref><ref name="werbos1974">{{cite book |last=Werbos |first=Paul J. |title=The Roots of Backpropagation : From Ordered Derivatives to Neural Networks and Political Forecasting |___location=New York |publisher=John Wiley & Sons |year=1994 |isbn=0-471-59897-6 }}</ref> Werbos described how he developed backpropagation in an interview. In 1971, during his PhD work, he developed backpropagation to mathematicize [[Sigmund Freud|Freud]]'s "flow of psychic energy". He faced repeated difficulty in publishing the work, only managing in 1981.<ref name=":1">{{Cite book |url=https://direct.mit.edu/books/book/4886/Talking-NetsAn-Oral-History-of-Neural-Networks |title=Talking Nets: An Oral History of Neural Networks |date=2000 |publisher=The MIT Press |isbn=978-0-262-26715-1 |editor-last=Anderson |editor-first=James A. |language=en |doi=10.7551/mitpress/6626.003.0016 |editor-last2=Rosenfeld |editor-first2=Edward}}</ref> He also claimed that "the first practical application of back-propagation was for estimating a dynamic model to predict nationalism and social communications in 1974" by him.<ref>P. J. Werbos, "Backpropagation through time: what it does and how to do it," in Proceedings of the IEEE, vol. 78, no. 10, pp. 1550–1560, Oct. 1990, {{doi|10.1109/5.58337}}</ref>
==Notes==
 
{{Reflist|group=note}}
Around 1982,<ref name=":1" />{{rp|376}} [[David E. Rumelhart]] independently developed<ref>Olazaran Rodriguez, Jose Miguel. ''[https://web.archive.org/web/20221111165150/https://era.ed.ac.uk/bitstream/handle/1842/20075/Olazaran-RodriguezJM_1991redux.pdf?sequence=1&isAllowed=y A historical sociology of neural network research]''. PhD Dissertation. University of Edinburgh, 1991.</ref>{{rp|252}} backpropagation and taught the algorithm to others in his research circle. He did not cite previous work as he was unaware of them. He published the algorithm first in a 1985 paper, then in a 1986 ''[[Nature (journal)|Nature]]'' paper an experimental analysis of the technique.<ref name="learning-representations">{{cite journal | last1 = Rumelhart | last2 = Hinton | last3 = Williams | title=Learning representations by back-propagating errors | journal = Nature | volume = 323 | issue = 6088 | pages = 533–536 | url = http://www.cs.toronto.edu/~hinton/absps/naturebp.pdf| doi = 10.1038/323533a0 | year = 1986 | bibcode = 1986Natur.323..533R | s2cid = 205001834 }}</ref> These papers became highly cited, contributed to the popularization of backpropagation, and coincided with the resurging research interest in neural networks during the 1980s.<ref name="RumelhartHintonWilliams1986a" /><ref name="RumelhartHintonWilliams1986b">{{cite book |editor1-last=Rumelhart |editor1-first=David E. |editor1-link=David E. Rumelhart |editor2-first=James L. |editor2-last=McClelland |editor2-link=James McClelland (psychologist) |title=Parallel Distributed Processing : Explorations in the Microstructure of Cognition |volume=1 : Foundations |last1=Rumelhart |first1=David E. |author-link1=David E. Rumelhart |last2=Hinton |first2=Geoffrey E. |author-link2=Geoffrey E. Hinton |first3=Ronald J. |last3=Williams |author-link3=Ronald J. Williams |chapter=8. Learning Internal Representations by Error Propagation |___location=Cambridge |publisher=MIT Press |year=1986b |isbn=0-262-18120-7 |chapter-url-access=registration |chapter-url=https://archive.org/details/paralleldistribu00rume }}</ref><ref>{{cite book|url={{google books |plainurl=y |id=4j9GAQAAIAAJ}}|title=Introduction to Machine Learning|last=Alpaydin|first=Ethem|publisher=MIT Press|year=2010|isbn=978-0-262-01243-0}}</ref>
 
In 1985, the method was also described by David Parker.<ref>{{Cite report |last=Parker |first=D.B. |date=1985 |title=Learning Logic: Casting the Cortex of the Human Brain in Silicon |department=Center for Computational Research in Economics and Management Science |___location=Cambridge MA |id=Technical Report TR-47 |publisher=Massachusetts Institute of Technology}}</ref><ref name=":0">{{Cite book |last=Hertz |first=John |title=Introduction to the theory of neural computation |date=1991 |publisher=Addison-Wesley |others=Krogh, Anders., Palmer, Richard G. |isbn=0-201-50395-6 |___location=Redwood City, Calif. |pages=8 |oclc=21522159}}</ref> [[Yann LeCun]] proposed an alternative form of backpropagation for neural networks in his PhD thesis in 1987.<ref>{{Cite thesis |title=Modèles connexionnistes de l'apprentissage |url=https://www.sudoc.fr/043586643 |publisher=Université Pierre et Marie Curie |date=1987 |place=Paris, France |degree=Thèse de doctorat d'état |first=Yann |last=Le Cun}}</ref>
 
Gradient descent took a considerable amount of time to reach acceptance. Some early objections were: there were no guarantees that gradient descent could reach a global minimum, only local minimum; neurons were "known" by physiologists as making discrete signals (0/1), not continuous ones, and with discrete signals, there is no gradient to take. See the interview with [[Geoffrey Hinton]],<ref name=":1" /> who was awarded the 2024 [[Nobel Prize in Physics]] for his contributions to the field.<ref>{{Cite web |title=The Nobel Prize in Physics 2024 |url=https://www.nobelprize.org/prizes/physics/2024/press-release/ |access-date=2024-10-13 |website=NobelPrize.org |language=en-US}}</ref>
 
=== Early successes ===
Contributing to the acceptance were several applications in training neural networks via backpropagation, sometimes achieving popularity outside the research circles.
 
In 1987, [[NETtalk (artificial neural network)|NETtalk]] learned to convert English text into pronunciation. Sejnowski tried training it with both backpropagation and Boltzmann machine, but found the backpropagation significantly faster, so he used it for the final NETtalk.<ref name=":1" />{{rp|p=324}} The NETtalk program became a popular success, appearing on the [[Today (American TV program)|''Today'' show]].<ref name=":02">{{Cite book |last=Sejnowski |first=Terrence J. |title=The deep learning revolution |date=2018 |publisher=The MIT Press |isbn=978-0-262-03803-4 |___location=Cambridge, Massachusetts London, England}}</ref>
 
In 1989, Dean A. Pomerleau published ALVINN, a neural network trained to [[Vehicular automation|drive autonomously]] using backpropagation.<ref>{{Cite journal |last=Pomerleau |first=Dean A. |date=1988 |title=ALVINN: An Autonomous Land Vehicle in a Neural Network |url=https://proceedings.neurips.cc/paper/1988/hash/812b4ba287f5ee0bc9d43bbf5bbe87fb-Abstract.html |journal=Advances in Neural Information Processing Systems |publisher=Morgan-Kaufmann |volume=1}}</ref>
 
The [[LeNet]] was published in 1989 to recognize handwritten zip codes.
 
In 1992, [[TD-Gammon]] achieved top human level play in backgammon. It was a reinforcement learning agent with a neural network with two layers, trained by backpropagation.<ref>{{cite book |last1=Sutton |first1=Richard S. |last2=Barto |first2=Andrew G. |title=Reinforcement Learning: An Introduction |edition=2nd |publisher=MIT Press |place=Cambridge, MA |year=2018 |chapter=11.1 TD-Gammon |chapter-url=http://www.incompleteideas.net/book/11/node2.html}}</ref>
 
In 1993, Eric Wan won an international pattern recognition contest through backpropagation.<ref name="schmidhuber2015">{{cite journal |last=Schmidhuber |first=Jürgen |author-link=Jürgen Schmidhuber |year=2015 |title=Deep learning in neural networks: An overview |journal=Neural Networks |volume=61 |pages=85–117 |arxiv=1404.7828 |doi=10.1016/j.neunet.2014.09.003 |pmid=25462637 |s2cid=11715509}}</ref><ref>{{cite book |last=Wan |first=Eric A. |title=Time Series Prediction : Forecasting the Future and Understanding the Past |publisher=Addison-Wesley |year=1994 |isbn=0-201-62601-2 |editor-last=Weigend |editor-first=Andreas S. |editor-link=Andreas Weigend |series=Proceedings of the NATO Advanced Research Workshop on Comparative Time Series Analysis |volume=15 |___location=Reading |pages=195–217 |chapter=Time Series Prediction by Using a Connectionist Network with Internal Delay Lines |editor2-last=Gershenfeld |editor2-first=Neil A. |editor2-link=Neil Gershenfeld |s2cid=12652643}}</ref>
 
=== After backpropagation ===
During the 2000s it fell out of favour{{citation needed|date=February 2022}}, but returned in the 2010s, benefiting from cheap, powerful [[GPU]]-based computing systems. This has been especially so in [[speech recognition]], [[machine vision]], [[natural language processing]], and language structure learning research (in which it has been used to explain a variety of phenomena related to first<ref>{{Cite journal|last1=Chang|first1=Franklin|last2=Dell|first2=Gary S.|last3=Bock|first3=Kathryn|date=2006|title=Becoming syntactic.|journal=Psychological Review|volume=113|issue=2|pages=234–272|doi=10.1037/0033-295x.113.2.234|pmid=16637761}}</ref> and second language learning.<ref>{{Cite journal|last1=Janciauskas|first1=Marius|last2=Chang|first2=Franklin|title=Input and Age-Dependent Variation in Second Language Learning: A Connectionist Account|journal=Cognitive Science|volume=42|pages=519–554|doi=10.1111/cogs.12519|pmid=28744901|pmc=6001481|year=2018|issue=Suppl Suppl 2 }}</ref>)<ref>{{Cite web |title=Decoding the Power of Backpropagation: A Deep Dive into Advanced Neural Network Techniques |url=https://www.janbasktraining.com/tutorials/backpropagation-in-deep-learning |website=janbasktraining.com |date=30 January 2024 |language=en}}</ref>
 
Error backpropagation has been suggested to explain human brain [[event-related potential]] (ERP) components like the [[N400 (neuroscience)|N400]] and [[P600 (neuroscience)|P600]].<ref>{{Cite journal|last1=Fitz|first1=Hartmut|last2=Chang|first2=Franklin|date=2019|title=Language ERPs reflect learning through prediction error propagation|journal=Cognitive Psychology|language=en|volume=111|pages=15–52|doi=10.1016/j.cogpsych.2019.03.002|pmid=30921626|hdl=21.11116/0000-0003-474D-8|s2cid=85501792|hdl-access=free}}</ref>
 
In 2023, a backpropagation algorithm was implemented on a [[photonic processor]] by a team at [[Stanford University]].<ref>{{Cite web |title=Photonic Chips Curb AI Training's Energy Appetite - IEEE Spectrum |url=https://spectrum.ieee.org/backpropagation-optical-ai |access-date=2023-05-25 |website=[[IEEE]] |language=en}}</ref>
 
==See also==
 
{{Portal|AI|Machine learning}}
* [[Artificial neural network]]
* [[BiologicalNeural neural networkcircuit]]
* [[Catastrophic interference]]
* [[Ensemble learning]]
Line 185 ⟶ 300:
* [[Neural backpropagation]]
* [[Backpropagation through time]]
* [[Backpropagation through structure]]
* [[Three-factor learning]]
 
==Notes==
{{Notelist}}
 
==References==
{{reflistReflist|230em}}
 
== Further reading ==
* {{cite book|last1=Goodfellow |first1=Ian |author-link1=Ian Goodfellow |last2=Bengio |first2=Yoshua |author-link2=Yoshua Bengio |last3=Courville |first3=Aaron |year=2016 |title=Deep Learning |url=http://www.deeplearningbook.org |publisher=MIT Press |section=6.5 Back-Propagation and Other Differentiation Algorithms
|section-url=https://www.deeplearningbook.org/contents/mlp.html#pf25
|pages=200–220
|isbn=9780262035613 }}
* {{cite book |last=Nielsen |first=Michael A. |author-link=Michael Nielsen |year=2015 |title=Neural Networks and Deep Learning |url=http://neuralnetworksanddeeplearning.com |chapter=How the backpropagation algorithm works |chapter-url=http://neuralnetworksanddeeplearning.com/chap2.html |publisher=Determination Press}}
*{{cite web |url=https://docs.microsoft.com/en-us/archive/msdn-magazine/2012/october/test-run-neural-network-back-propagation-for-programmers |title=Neural Network Back-Propagation for Programmers |first=James |last=McCaffrey |date=October 2012 |work=[[MSDN Magazine]] }}
*{{cite book |chapter-url=https://page.mi.fu-berlin.de/rojas/neural/chapter/K7.pdf |chapter=The Backpropagation Algorithm |title=Neural Networks : A Systematic Introduction |first=Raúl |last=Rojas |author-link=Raúl Rojas |___location=Berlin |publisher=Springer |year=1996 |isbn=3-540-60505-3 }}
 
==External links==
* [[Wikiversity:Learning and Neural Networks|Backpropagation neural network tutorial at the Wikiversity]]
* {{cite web |url=http://galaxy.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html |title=Principles of training multi-layer neural network using backpropagation |first1=Mariusz |last1=Bernacki |first2=Przemysław |last2=Włodarczyk |date=2004 }}
* {{cite web |work=CS231n |date=2016 |publisher=Stanford University |first=Andrej |last=Karpathy |author-link=Andrej Karpathy |title=Lecture 4: Backpropagation, Neural Networks 1 |url=https://www.youtube.com/watch?v=i94OvYb6noo&list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC&index=4 |archive-url=https://ghostarchive.org/varchive/youtube/20211212/i94OvYb6noo| archive-date=2021-12-12 |url-status=live|via=[[YouTube]] }}{{cbignore}}
* {{cite web |work=3Blue1Brown |title=What is Backpropagation Really Doing? |date=November 3, 2017 |url=https://www.youtube.com/watch?v=Ilg3gGewQ5U&list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi&index=3 |archive-url=https://ghostarchive.org/varchive/youtube/20211212/Ilg3gGewQ5U| archive-date=2021-12-12 |url-status=live|via=[[YouTube]] }}{{cbignore}}
* {{cite web |url=https://sudeepraja.github.io/BackpropAdjoints/ |title=Yet Another Derivation of Backpropagation in Matrix Form |first1=Sudeep Raja |last1=Putta |date=2022 }}
 
{{Artificial intelligence navbox}}
== External links ==
{{Authority control}}
*[http://numericinsight.com/uploads/A_Gentle_Introduction_to_Backpropagation.pdf A Gentle Introduction to Backpropagation - An intuitive tutorial by Shashi Sathyanarayana] The article contains pseudocode ("Training Wheels for Training Neural Networks") for implementing the algorithm.
*[http://msdn.microsoft.com/en-us/magazine/jj658979.aspx Neural Network Back-Propagation for Programmers (a tutorial)]
*[http://www.matematica.ciens.ucv.ve/dcrespin/Pub/backprop.pdf Backpropagation for mathematicians]
* Chapter 7 [http://page.mi.fu-berlin.de/rojas/neural/chapter/K7.pdf The backpropagation algorithm] of [http://page.mi.fu-berlin.de/rojas/neural/index.html.html ''Neural Networks - A Systematic Introduction''] by [[Raúl Rojas]] (ISBN 978-3540605058)
*[http://www.tek271.com/documents/others/into-to-neural-networks Quick explanation of the backpropagation algorithm]
*[http://galaxy.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html Graphical explanation of the backpropagation algorithm]
*[http://pandamatak.com/people/anand/771/html/node37.html Concise explanation of the backpropagation algorithm using math notation] by Anand Venkataraman
*[http://rrusin.blogspot.com/2016/03/learning-sinus-function-using-neural.html Visualization of a learning process using backpropagation algorithm]
*[[Wikiversity:Learning and Neural Networks|Backpropagation neural network tutorial at the Wikiversity]]
 
[[Category:Machine learning algorithms]]
[[Category:Artificial neural networks]]
[[Category:Articles with example pseudocode]]