Algorithms

Neural Network Forward Pass

A tiny 3-4-2 network. Watch the forward pass compute weighted sums, apply activations, and produce two output scores.

6 minLevel 2/3The interactive stage stays ad-free.
Inputs3Hidden4Output 10.320Output 20.578
0.90.20.60.400.850.43-0.690.320.58inputhidden (tanh)output (sigmoid)

Edges are weighted connections: cyan is positive, rose is negative, thickness shows magnitude. The forward pass computes hidden activations first, then output probabilities. Step through it.

What you are seeing

1

Each connection has a weight. A neuron computes the weighted sum of its inputs plus a bias.

2

An activation function such as tanh or sigmoid adds non-linearity, allowing the network to model complex patterns.

3

The forward pass flows left to right and produces the output layer predictions.

Why it matters

Every deep-learning model, from image classifiers to language models, is built from layers of these weighted sums and activations.

Complexity & details

Forward pass cost: O(number of weights), because each connection contributes one multiply-add.

Frequently asked questions

What is the difference between forward and backward propagation?+

Forward propagation computes predictions. Backpropagation uses the error to compute gradients and update weights.

Why are non-linear activations necessary?+

Without them, stacked linear layers collapse into a single linear transformation, and the network cannot learn curved decision boundaries.