liveBook · Manning

Forward pass

As explained in Grokking AI Algorithms, Second Edition

A forward pass is the computation that propagates input through a model to produce predictions.

A forward pass propagates an input through a neural network to produce a prediction. Each layer transforms the result before passing it onward, like moving through a sequence of decision steps. section 9.4 section 11.32

A basic forward pass through a network follows this sequence:

  • Input one example, such as scaled speed, terrain quality, degree of vision, and driving experience. section 9.4
  • Multiply each input by the weights connecting it to hidden nodes, then sum the weighted inputs for each node. section 9.4
  • Apply an activation function to each hidden-node sum, combine those activated values at the output node, and activate the final sum. section 9.4
  • Use the final output as the model’s prediction, such as the estimated chance that a collision will occur. section 9.4

A small neural-network calculation

A pretrained network receives one scaled driving example. It multiplies the four inputs by their connection weights, sums these values for every hidden node, applies sigmoid activation, combines the hidden outputs, and applies sigmoid again to produce the collision prediction. The same pattern can be written as: inputs → weighted hidden layer → activation → weighted output layer → activation. section 9.4 section 9.24

A simple implementation stores input-to-hidden and hidden-to-output weights, computes the hidden activations, and computes the output activations. During training, the forward pass supplies predictions for loss calculation; backpropagation then uses that loss to adjust the weights. section 9.4 section 9.5 section 11.32

Figure 9.14 Life cycle of forward propagation in an ANN
09_14

Follow the life cycle from input through weighted sums and activation functions to the final prediction. section 9.4

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Traces weighted sums, hidden and output activations, matrix operations, and a compact equation, while deferring weight adjustment to backpropagation.
Examples
Uses a scaled car-collision dataset, pretrained connection weights, sigmoid calculations, Python code, and Transformer token batches.
What it assumes
Assumes basic neural-network architecture and inputs, while explaining weighted sums, hidden nodes, activation functions, and predictions from the ground up.
What you can do after
Apply it to trace or implement prediction flow through a multilayer neural network before calculating loss or updating weights.
How it connects
Connects artificial neural networks with perceptrons, activation functions, backpropagation, loss, embeddings, self-attention, and feed-forward networks.

Also explained in

Compare how 8 books explain forward pass →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.