liveBook · Manning

Backpropagation

As explained in Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

Backpropagation is a procedure for computing derivatives of an output or loss with respect to inputs and parameters by applying the chain rule backward through a computational graph.

Backpropagation trains a feed-forward neural network by identifying errors after signals pass through it and sending corrective adjustments backward, especially to neurons most responsible for those errors. Neurons combine inputs and weights, then apply an activation function; that function needs a computable derivative for backpropagation. Sigmoid is one example, with outputs between 0 and 1. section 7.2 section 7.4

Training proceeds through related calculations:

  • Calculate a delta for an output neuron. section 7.2
  • Calculate deltas for neurons in hidden layers. section 7.2
  • Update hidden- and output-layer weights using the deltas, prior weights and inputs, and a user-chosen learning rate. section 7.2
Figure 7.4. The mechanism by which an output neuron’s delta is calculated during the backpropagation phase of training

The diagram shows how an output neuron's delta is calculated. section 7.2

Figure 7.5. How a delta is calculated for a neuron in a hidden layer

The diagram shows how a hidden-layer neuron's delta is calculated. section 7.2

Figure 7.6. The weights of every hidden layer and output layer neuron are updated using the deltas calculated in the previous steps, the prior weights, the prior inputs, and a user-determined learning rate.

The diagram shows weight updates based on deltas, prior values, and a learning rate. section 7.2

How Classic Computer Science Problems in Swift: Essential techniques for practicing programmers covers it

How deep it goes
Explains output and hidden-layer deltas and weight updates, but uses calculus derivations rather than deriving them.
Examples
Uses output- and hidden-neuron delta diagrams and a sigmoid activation function with its derivative.
What it assumes
Uses vectors, dot products, and derivatives while leaving vector and dot-product explanations and calculus derivations aside.
What you can do after
Apply the procedure to calculate neuron deltas and update network weights using a learning rate.
How it connects
Connects neural networks with neurons, layers, activation functions, derivatives, and learning rates.

Also explained in

Compare how 17 books explain backpropagation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Computer Science Problems in Swift: Essential techniques for practicing programmers. The section links point to the parts of the book it draws on.