Forward Pass

A forward pass is the computation that turns input into prediction.

inputxstep 1z = wx + bstep 2a = relu(z)outputy_hat
A forward pass computes values from left to right. No parameter update happens inside this pass.

It is called forward because values move from the input side of the model toward the output side.

In a tiny model:

y_hat = wx + b

the forward pass is:

take x
multiply by w
add b
return y_hat

No learning happens inside this computation. The model only uses its current parameters.

Forward pass with a batch

If X has shape (batch, input_features), a forward pass may compute:

Y_hat = XW + b

If:

X shape: (4, 3)
W shape: (3, 2)
b shape: (2)

then:

Y_hat shape: (4, 2)

The forward pass gives one output row for each input row.

DL-C02-T03-001Exercise: Forward-pass output shape

X has shape (5, 4), W has shape (4, 2), and b has shape (2). What is the shape of XW + b?

Compute it first, then check your number.

HintMultiply before adding the bias

(5, 4) x (4, 2) gives (5, 2).

SolutionWork it out

XW has shape (5, 2). The bias b has one value per output feature and broadcasts across the 5 rows, so the final output shape is (5, 2).

DL-C02-T03-002Exercise: Does learning happen here

During a single forward pass, are the parameters updated? Enter 1 for yes or 0 for no.

Compute it first, then check your number.

HintForward means compute

Parameter updates come later, after loss and gradients.

SolutionWork it out

A forward pass computes outputs from inputs and current parameters. It does not update the parameters.