Skip to content

Module 07

Anurag Prasad edited this page Nov 7, 2026 · 10 revisions

Module 07: Feedforward Neural Networks and Backpropagation

Level: Intermediate
Status: Planned — navigation and lesson specifications

Module purpose

This module is a self-contained learning unit within the larger Deep Learning curriculum. Its purpose is to build understanding from motivation and prerequisites through mathematical reasoning, implementation and critical evaluation.

Introduction and conceptual foundation

A feedforward network composes layers to map inputs to predictions. Forward propagation computes activations; backpropagation applies the chain rule from the loss toward earlier layers to obtain parameter gradients efficiently.

How the ideas develop

Trace one example through a network and record every tensor shape. Derive gradients for a single neuron, extend to a multilayer network, and compare scalar and vectorized forms. Use finite differences to check implementation correctness.

What the reader should be able to explain

By the end of this module, a reader should be able to define its central objects, explain the motivation behind its main methods, interpret the governing equations, work through a small example, and identify assumptions and limitations. The goal is understanding the mechanism—not memorizing a list of terms.

Learning outcomes

  • Derive gradients for a two-layer MLP.
  • Explain intermediate activations in backpropagation.
  • Distinguish forward and backward computations.

Navigation

Focused submodules and topic extensions

Each page below isolates a specific concept or closely related group of concepts. The page isolates a specific concept or closely related group of concepts for focused study.

Topic-wise lessons

  1. Module-07-Lesson-01
  2. Module-07-Lesson-02
  3. Module-07-Lesson-03
  4. Module-07-Lesson-04
  5. Module-07-Lesson-05
  6. Module-07-Lesson-06
  7. Module-07-Lesson-07
  8. Module-07-Lesson-08
  9. Module-07-Lesson-09

How to complete this module

  1. Study the lessons in prerequisite order.
  2. Write a notation sheet and derive central equations.
  3. Solve at least one hand-worked example per major mechanism.
  4. Implement core operations where appropriate.
  5. Verify outputs and gradients.
  6. Complete conceptual and coding exercises.
  7. Record limitations and research extensions.

Completion status

  • Conceptual understanding
  • Mathematical derivations
  • Worked numerical examples
  • NumPy implementation (where applicable)
  • PyTorch implementation (where applicable)
  • Tests and numerical verification
  • Experiments and interpretation
  • Revision and self-assessment

Technical chapter

1. Why this area matters

A feedforward neural network is a composition of affine maps and non-linearities. Backpropagation applies the chain rule efficiently by propagating sensitivities from the output toward earlier layers and accumulating parameter gradients.

2. Core mathematical formulation

For layer l: $$ a^{(l)}=W^{(l)}h^{(l-1)}+b^{(l)}, \qquad h^{(l)}=\phi(a^{(l)}). $$

For a scalar loss, define $\delta^{(l)}=\partial L/\partial a^{(l)}$. Then $$ \frac{\partial L}{\partial W^{(l)}}= \delta^{(l)}(h^{(l-1)})^\top, \qquad \delta^{(l-1)}=(W^{(l)})^\top\delta^{(l)}\odot\phi'(a^{(l-1)}). $$

3. Worked reasoning example

For a one-hidden-unit network $h=\sigma(wx)$ and output $\hat y=vh$, the derivative of squared error is a product of local derivatives: $\partial L/\partial v=(\hat y-y)h$ and $\partial L/\partial w=(\hat y-y)v h(1-h)x$.

4. Conceptual flow

flowchart LR
  A[Input] --> B[Hidden layer 1]
  B --> C[Hidden layer 2]
  C --> D[Output and loss]
  D -. backward gradients .-> C
  C -. chain rule .-> B
  B -. chain rule .-> A
Loading

5. Implementation and verification

Implement a tiny network using NumPy and compare each parameter gradient against PyTorch autograd and finite differences. Test batch and single-example cases separately.

6. Common failure modes and misconceptions

Backpropagation is a gradient-computation algorithm, not an optimizer. Gradients must be accumulated correctly across a batch. In-place operations can invalidate saved tensors. A wrong reduction (sum versus mean) changes gradient scale.

7. Advanced and research directions

Study computational graphs, checkpointing, reverse-mode autodiff, residual networks and gradient accumulation for large batches.

8. Suggested practical assignment

  1. Reproduce the smallest mathematical example by hand.
  2. Implement the central operation using NumPy.
  3. Implement the same operation using PyTorch.
  4. Compare outputs and gradients with numerical tolerances.
  5. Change one assumption or hyperparameter and document what changes.
  6. Record environment, random seed, data split, compute budget and limitations.

9. Completion criteria

  • Explain the motivation and assumptions without notes.
  • Derive the principal equations and define every symbol.
  • Complete at least one worked numerical example.
  • Trace tensor shapes through the computation.
  • Implement and test the central mechanism.
  • Explain at least two failure modes.
  • Read one primary paper and summarize its contribution and limitations.

Content status: This page now contains a technical chapter and a practical learning specification. The linked lesson pages provide focused subtopic treatment; experiments are not claimed complete until their result logs are added.

🎓 Deep Learning Hub

🏠 Home · 🗺️ Curriculum · 🧭 Learning paths

❓ Question bank · 📖 Glossary · 📚 References

Jump to module:

01 02 03 04 05 06 07 08 09 10 11 12

13 14 15 16 17 18 19 20 21 22 23 24

Part 1 · Mathematical foundations
Part 2 · Neural network fundamentals
Part 3 · Training deep networks
Part 4 · Core architectures
Part 5 · Representation and generative learning
Part 6 · Specialised, modern and responsible deep learning
Reference and meta

Clone this wiki locally