liveBook · Manning

Forward pass

As explained in Deep Learning with R, Third Edition

A forward pass is the propagation of input values through a computational graph in the direction of its outputs.

A forward pass propagates input values through a computational graph from inputs to outputs. In a neural network, it produces predictions by applying operations such as matrix multiplication, bias addition, and activation functions. section 2.4.4 section 2.4

A scalar computation graph

Given an input x, weight w, and bias b, compute an intermediate value with x × w, add b, and compare the resulting prediction y with a target using a loss function. Propagating these values to the loss is the forward pass; calculating parameter derivatives afterward is the backward pass. section 2.4.4

A forward pass occupies the prediction stage of a training loop:

  • Draw a batch of inputs and corresponding targets. section 2.4
  • Run the model on the inputs to obtain predictions. section 2.4 section 2.4.3
  • Compute the loss by comparing predictions with targets, then use the backward pass to calculate gradients and update parameters. section 2.4.3
Figure 2.22 Running a forward pass
figure

Use the computation-graph figure to trace values from inputs through intermediate operations to the loss. section 2.4.4

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines graph-wide value propagation and illustrates it with scalar arithmetic, stopping before detailed implementation of large-network execution.
Examples
Uses scalar multiplication and addition, a two-layer model, and a mini-batch training loop to demonstrate prediction.
What it assumes
Assumes familiarity with basic tensor operations and introduces the forward pass through elementary graph calculations.
What you can do after
Understand how neural networks turn input batches into predictions and how those predictions supply loss values for optimization.
How it connects
Connects computational graphs, neural networks, loss functions, backward passes, gradients, and stochastic gradient descent.

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 Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.