Skip to main content
Machine Learning & Deep Learning

⏱ About 15 min15 XP

The Forward Pass

You now understand neurons, weights, layers, and activation functions. Put them together and you have everything needed to understand the forward pass: the journey a piece of data takes through a neural network from raw input all the way to a final prediction. Every time you ask a trained network a question — Is this email spam? What digit is this? What is the next word? — the forward pass happens in milliseconds.

Step by Step Through the Network

The forward pass is called 'forward' because information moves in one direction only: from the input layer, through each hidden layer in order, to the output layer. Nothing goes backward during a forward pass. (Backward is for learning — that comes next lesson.) Here is the exact sequence of events: Step 1 — Load the inputs. Raw data is converted to numbers and placed into the input neurons. An image becomes a list of pixel values. A word becomes a vector of numbers representing its meaning. Step 2 — Compute the first hidden layer. Each neuron in hidden layer 1 takes all input values, multiplies each by its own weight, adds them up (the weighted sum), then applies its activation function. The result is the neuron's activation — the number it sends forward. Step 3 — Repeat for each subsequent layer. Hidden layer 2 receives the activations from hidden layer 1. Each of its neurons computes its own weighted sum of those activations, applies its activation function, and sends results forward. This continues layer by layer. Step 4 — Reach the output layer. The final layer applies its activation function (sigmoid for binary, softmax for multi-class) and produces the network's answer.

Activation vs. Weighted Sum

A neuron's weighted sum is the raw result of multiplying inputs by weights and adding. The neuron's activation is what it sends forward after applying the activation function. These are two distinct numbers. In common usage, 'activation' refers to the output of a neuron — the post-activation value.

Let us trace a tiny forward pass completely. The network decides if a number is closer to 1 or to 0. Architecture: 2 inputs, 1 hidden layer with 2 neurons (using ReLU), 1 output neuron (using sigmoid). Inputs: x1 = 0.8, x2 = 0.3 Hidden neuron H1: Weights: w1=1.0, w2=-0.5 Weighted sum: (0.8×1.0) + (0.3×-0.5) = 0.8 - 0.15 = 0.65 ReLU(0.65) = 0.65 (positive, so unchanged) Activation: 0.65 Hidden neuron H2: Weights: w1=-1.2, w2=2.0 Weighted sum: (0.8×-1.2) + (0.3×2.0) = -0.96 + 0.6 = -0.36 ReLU(-0.36) = 0 (negative, so zeroed out) Activation: 0 Output neuron: Inputs: H1=0.65, H2=0 Weights: wH1=0.9, wH2=0.4 Weighted sum: (0.65×0.9) + (0×0.4) = 0.585 Sigmoid(0.585) ≈ 0.642 Output: 0.642 Interpretation: 0.642 — closer to 1 than to 0, so the network predicts class 1 with 64% confidence. Every neural network, no matter how large, runs this same operation: weighted sum, activation, next layer.

What the Network Is Actually Doing

The forward pass looks like arithmetic — and it is — but something remarkable happens across layers. The first hidden layer detects simple features. If the input is an image, early neurons might activate strongly for edges, colors, or corners. The second hidden layer combines those features into textures and shapes. Deeper layers combine those into parts of objects. The output layer combines those into a final decision. This hierarchical feature learning is what emerges from training with stacked layers and activation functions. Nobody programs 'look for edges first.' The network discovers useful intermediate representations on its own, guided only by the goal of getting the output right.

Prompt Challenge

Write a prompt asking an AI assistant to explain the forward pass to a younger sibling (ages 8-10) using a real-world analogy — no math, no jargon.

Your prompt should…

  • Specify the target audience age range so the AI knows how simple to keep the language
  • Ask for a specific real-world analogy like an assembly line or a relay race
  • Request a short explanation of 3 to 5 sentences only
The Network Does Not Think

During the forward pass, there is no reasoning, no understanding, no consciousness. There is only arithmetic: multiply, add, apply a function, repeat. The illusion of intelligence comes from training millions of these simple operations on billions of examples. The magic is in the weights, not in any single step.

During a forward pass, in which direction does information flow?

In the worked example, hidden neuron H2 output an activation of 0 even though it received valid inputs. Why?

Human Forward Pass

  1. Step 1: Form groups of five people: one input layer person, two hidden layer people, and one output layer person, plus one scorekeeper.
  2. Step 2: The scorekeeper gives the input person two numbers (inputs).
  3. Step 3: The input person shares the numbers with both hidden layer people.
  4. Step 4: Hidden person 1 multiplies input 1 by 2 and input 2 by -1, adds them, and applies ReLU (if negative, say zero). Hidden person 2 multiplies input 1 by -1 and input 2 by 3, adds them, and applies ReLU.
  5. Step 5: Both hidden people share their results with the output person. The output person multiplies hidden 1's result by 0.5 and hidden 2's result by 0.5, adds them, and announces the final number.
  6. Step 6: The scorekeeper records the output. Try three different pairs of inputs and notice how the output changes.