Skip to content
StackDecode
AI & ML Atlas
Neural NetworksalgorithmInteractive simulation

Forward Propagation

Passing an input through the network to get a prediction.

The idea

Each layer multiplies its input by weights, adds a bias and applies the activation. The prediction is the final layer's output. The intermediate values are stored because backpropagation will need them.

a⁽ˡ⁾ = f(W⁽ˡ⁾a⁽ˡ⁻¹⁾ + b⁽ˡ⁾)

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

0.80.3h1h2h3out
  • activation
  • not computed yet

The two inputs enter the network: x1 = 0.8, x2 = 0.3. Thick lines are strong weights (blue positive, orange negative).

1/5

Drag the two input sliders: the same fixed weights give a different answer each time.

Step by step

  1. 1Set the activations of the input layer to the input.
  2. 2For each layer compute z = W·a + b.
  3. 3Apply the activation: a = f(z).
  4. 4The last layer's activation is the prediction.
  5. 5Compute the loss against the target.

Where it is used

Both training and inference.

Watch out for

Numerical overflow in softmax and exp; use stable formulations.

Related