Learning path

AI concepts from scratch

Neurons, training, regression, classification, attention, text generation, search and reinforcement learning: one short lesson per idea, each followed by challenges.

14 lessons · 47 challenges

Start the path →

1 Neural networks 4 lessons

  1. Lesson 3 challenges Neurons and Activation Functions in Python Build an artificial neuron in plain Python: a weighted sum of inputs plus a bias, passed through sigmoid or ReLU.
  2. Lesson 3 challenges Forward Propagation and Loss Functions in Python Pass inputs through a small neural network layer by layer, then measure the error with squared error and cross-entropy.
  3. Lesson 5 challenges Gradient Descent and Backpropagation in Python Train a neuron with gradient descent: use the chain rule to find how each weight affects the loss, then step downhill.
  4. Lesson 4 challenges Neural Network Optimizers: SGD, Momentum and Adam in Python Compare plain gradient descent, momentum and Adam by minimising the same function step by step.

2 Machine learning 4 lessons

  1. Lesson 3 challenges Data Preparation for Machine Learning in Python Scale features with min-max normalization and z-score standardization, and multiply matrices by hand.
  2. Lesson 4 challenges Linear and Logistic Regression in Python Fit a straight line with least squares, then turn a score into a probability with logistic regression.
  3. Lesson 6 challenges Classification Basics: Softmax and k-Nearest Neighbours in Python Turn scores into class probabilities with softmax, score them with cross-entropy and classify points with k-nearest neighbours.
  4. Lesson 2 challenges Cosine Similarity and k-Means Clustering in Python Measure how similar two vectors are with cosine similarity and group unlabelled data with k-means.

3 Transformers and LLMs 3 lessons

  1. Lesson 3 challenges Tokenization: Vocabulary, One-Hot and Byte Pair Encoding in Python Turn text into numbers the way language models do: build a vocabulary, one-hot encode words and learn subword tokens with BPE.
  2. Lesson 4 challenges Attention and Self-Attention in Python Compute scaled dot-product attention by hand with queries, keys and values, then add a causal mask like GPT.
  3. Lesson 2 challenges How Language Models Generate Text: Temperature and Top-k in Python See how a language model picks the next token: layer normalization, temperature and top-k sampling in plain Python.

4 Classical AI and reinforcement learning 3 lessons

  1. Lesson 4 challenges Search and Game AI: A* and Minimax in Python Find the shortest path on a grid with A* search and pick the best move in a game with minimax.
  2. Lesson 2 challenges Markov Chains and the Explore-Exploit Trade-off in Python Predict future states with a Markov chain and balance exploring and exploiting with an epsilon-greedy bandit.
  3. Lesson 2 challenges Reinforcement Learning: Value Iteration and Q-Learning in Python Teach an agent to reach a goal: compute state values with value iteration, then learn them by trial and error with Q-learning.
Continue with: Neural networks from scratch