Skip to main content
Module 10 · Lesson 4 of 649/56 in the course~25 min
Module lessons (4/6)

MLP from scratch with NumPy

Lesson preview5 hands-on exercises readyMachine Learning: from first principles to practice · Module 10 — Neural networks and deep learning

Forward pass, backward pass, and conquering XOR in pure NumPy.

What you'll learn in this lesson

  • Implement the forward pass of a 2-layer neural network with NumPy matrix operations.
  • Implement the backward pass and gradient updates.
  • Train the network to conquer the non-linear XOR problem with 100% accuracy.

Overview

In Lesson 1 we saw that a single perceptron failed on the XOR problem because no single line can separate the diagonally opposed classes.

Now, we assemble a complete 2-layer Multi-Layer Perceptron (MLP) from scratch in pure NumPy:

Sections covered in this lesson

  1. 1Solving what a single neuron could not
  2. 2Tensor shapes across the two layers
  3. 3The mathematics of the forward and backward passes
  4. 4Practice
  5. 5Check your understanding
Pro Lesson · Module 10 — Neural networks and deep learning

Unlock "MLP from scratch with NumPy" and the full Machine Learning: from first principles to practice curriculum

Forward pass, backward pass, and conquering XOR in pure NumPy.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.