Course contentsShow
← Machine Learning and Deep Learning
Lesson 605 of 3,53815. Neural Network FoundationsFree lesson

Layer-by-Layer Computation

How data flows through network layers sequentially, with each layer's output becoming the next layer's input.

Layer-by-Layer Computation

What you'll learn: How neural networks process data step-by-step, with each layer transforming its input and passing the result forward.

The Core Idea

In a neural network, data doesn't magically jump from input to output. Instead, it flows through the network one layer at a time, like an assembly line. Each layer receives input, performs its computation (weighted sum plus activation function), and passes the result to the next layer. The output of layer i becomes the input to layer i+1.

The Sequential Flow

Think of it like a relay race: each runner (layer) receives the baton (data), does their part (computation), and hands it off to the next runner. You cannot skip runners—the race must proceed in order.

For a network with layers numbered 0 (input) through L (output):

  1. Layer 0 receives raw input features x
  2. Layer 1 computes using layer 0's output: transforms and activates
  3. Layer 2 uses layer 1's output as its input
  4. This continues until Layer L produces the final prediction

Each layer applies: output = activation(weights · input + bias)

The result becomes the next layer's input vector.

Why This Matters

This sequential, layer-by-layer approach is what makes deep learning "deep"—each layer extracts increasingly abstract features from the previous layer's representation. The first hidden layer might detect edges, the second might detect shapes, and so on, building complexity as data flows forward.

Key Takeaway: Forward propagation is a sequential process where each layer transforms its input and passes the output forward, creating a chain of computations from input to prediction.