AI learning path

Build a neural network from scratch in Python

15 challenges take you from the dot product to a network that learns XOR, then on to modern optimizers like Adam, with no AI libraries: neurons, activations, loss, gradients, backpropagation and training. Solve them in order in Python; each one runs in your browser with instant tests and an AI review.

  1. 1

    Building blocks

    Vectors, activation functions and a single neuron.

    0/3
    1. 1 Dot Product of Two Vectors Easy Solve in Python
    2. 2 Activation Functions Easy Solve in Python
    3. 3 Single Artificial Neuron Easy Solve in Python
  2. 2

    Forward pass

    Layers, a two-layer network and loss functions.

    0/3
    1. 1 Dense Layer Forward Pass Medium Solve in Python
    2. 2 Forward Propagation in a Two-Layer Network Medium Solve in Python
    3. 3 Loss Functions: MSE, MAE and Cross-Entropy Easy Solve in Python
  3. 3

    Training

    Gradients, backpropagation and gradient descent, up to solving XOR.

    0/5
    1. 1 Derivatives of Activation Functions Easy Solve in Python
    2. 2 Gradients of a Single Neuron Medium Solve in Python
    3. 3 Backpropagation in a Two-Layer Network Hard Solve in Python
    4. 4 Train a Neuron with Gradient Descent Medium Solve in Python
    5. 5 Train a Neural Network to Solve XOR Hard Solve in Python
  4. 4

    Better training

    Weight initialization, mini-batches, momentum and Adam.

    0/4
    1. 1 Xavier and He Weight Initialization Easy Solve in Python
    2. 2 Mini-Batch Gradient Descent Medium Solve in Python
    3. 3 Gradient Descent with Momentum Easy Solve in Python
    4. 4 Adam Optimizer Medium Solve in Python