Free course · 12 hands-on notebooks · no GPU needed
Neural Networks 1001
From a single artificial neuron to a GPT you train yourself. Every idea is built from first principles in code you can read, run and break, on an ordinary laptop, in minutes.
- 12modules
- ~19 hof study
- 0GPUs or API keys
- 100%runnable code
Build it, then use the library
Every core idea is first written by hand in NumPy or a few lines of PyTorch, checked numerically, and only then replaced by the framework version.
Small enough for a laptop
Models are sized to train on a CPU in seconds to minutes while still showing the real behaviour: learned filters, attention that reorders words, skills that emerge during training.
Honest results
Every model is compared with a baseline, every metric is measured on held-out data, and the notebooks say plainly when a technique does not help.
Syllabus
Four parts, 12 modules: the foundations (including reinforcement learning), the classic architectures (images, sequences and language), advanced applications (transformers, language models, time series and modern vision), and a capstone that puts it all to work on a real case. Each module is one notebook: read the explanations, run the cells, then try the exercises at the end. Your progress is remembered in this browser.
Foundations
How a network computes, learns, generalises and learns from rewards.
The Artificial Neuron
Build a neuron in ten lines of NumPy, meet every activation function used in modern AI, and train it with gradient descent.
- weights & bias
- activations
- vanishing gradients
- perceptron
- gradient descent
Neural Networks and Backpropagation
Stack neurons into layers, write a tiny autograd engine, derive backprop by hand, check it numerically and compare optimisers.
- MLP
- chain rule
- autograd
- gradient checking
- SGD, momentum, Adam
- initialisation
Training Deep Networks Well
Generalisation is the real goal: diagnose bias and variance, regularise, normalise, schedule, search hyperparameters and decide what to fix next.
- train/dev/test
- bias & variance
- weight decay
- dropout
- batch norm
- LR schedules
- error analysis
Reinforcement Learning: Learning from Rewards
Nobody labels the right move, you only score the outcome: bandits, Q-learning on a cliff, REINFORCE on cart-pole, PPO, and an agent that hacks its reward.
- bandits
- exploration vs exploitation
- Q-learning
- REINFORCE
- actor-critic & PPO
- reward hacking
Classic architectures
The inductive biases for images, sequences and language.
Convolutional Neural Networks
Convolution from scratch, a CNN on handwritten digits, data augmentation, residual connections, transfer learning and efficient convolutions.
- convolution
- pooling
- augmentation
- ResNet
- transfer learning
- depthwise-separable
Recurrent Networks
RNNs and LSTMs forecast hourly demand against a seasonal baseline; measure vanishing gradients through time; forecast a full day ahead.
- RNN
- LSTM & GRU
- BPTT
- calendar features
- recursive vs direct forecasting
Classic NLP: Embeddings, Seq2seq and Attention
Train word2vec-style embeddings and find analogies, measure and remove a planted bias, then translate English to Spanish with attention and beam search.
- skip-gram
- analogies
- embedding bias
- encoder-decoder
- attention
- beam search
Advanced applications with NN
Attention and GPT-style language models, time series forecasting and modern vision tasks.
Time Series Forecasting with Neural Networks
Real bike-sharing demand and simulated river flow: GRU, LSTM and patch Transformer against seasonal baselines and XGBoost, then a pre-trained foundation model used zero-shot.
- rolling-origin evaluation
- XGBoost baseline
- GRU, LSTM, patch Transformer
- TimesFM zero-shot
- quantile forecasts
- decision guide
Building a Transformer
Positional encodings, scaled dot-product and multi-head attention, masks, residual stream and LayerNorm, then a full transformer that learns to sort.
- self-attention
- multi-head
- masking
- LayerNorm
- attention rollout
Large Language Models: a GPT from Scratch
Pre-train a character-level GPT on a multi-task corpus, watch skills emerge, sample, add a KV cache, fine-tune, and see why scale matters.
- tokenisation
- next-token prediction
- emergent skills
- sampling
- KV cache
- fine-tuning
Vision Beyond Classification
Segment every pixel with a U-Net, detect objects YOLO-style with non-maximum suppression, and recognise unseen classes with a triplet-loss embedding.
- U-Net
- IoU
- YOLO
- NMS
- precision & recall
- triplet loss
Capstone
Everything together on a real case, from the raw photos to a model you could put on a production line.
Run it yourself
Each lesson page shows the notebook with its saved outputs, so you can read the whole course in the browser. To experiment, download a notebook or open it in Google Colab from the lesson page, or clone the repository and run everything locally:
git clone https://github.com/fborbon/academy.git
cd academy/neural-networks
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
jupyter lab
What you need
- Python: comfortable with functions, loops and lists. NumPy experience helps but is introduced as we go.
- Maths: high-school algebra; derivatives are explained when they appear. No linear algebra course required.
- Hardware: any laptop from the last decade. The longest notebooks (time series with a foundation model, and the capstone) take about 35 minutes on a CPU; most take a few minutes.
Data and credits
- Notebooks 01 to 06 and 08 to 11 use data generated in the notebooks (synthetic signals, grammars, environments and shape scenes) or bundled with scikit-learn, so nothing is downloaded.
- Handwritten digits: “Optical Recognition of Handwritten Digits”, Alpaydin, E. and Kaynak, C., UCI Machine Learning Repository, as bundled with scikit-learn.
- Sample photograph in notebook 05: china.jpg by danielbuechele (Flickr, CC BY 2.0), as bundled with scikit-learn.
- Notebook 07: Bike Sharing, Fanaee-T, H. and Gama, J. (2013), UCI Machine Learning Repository, dataset page, CC BY 4.0, downloaded once. The optional zero-shot forecasts use the TimesFM 3 weights (Das et al., 2024), published under a non-commercial licence: fine for learning, not for commercial use.
- Capstone (notebook 12): GKN Blade Surface Defect Dataset, Zhou, Q. (2023), Mendeley Data, V1, doi:10.17632/3bh998k78g.1, CC BY 4.0. Downloaded once from the original publication.
- Pre-trained ResNet-18 weights (ImageNet, from torchvision): He et al. (2015); ImageNet, Deng et al. (2009). Downloaded once.
Further reading
- He et al., Deep Residual Learning for Image Recognition (2015)
- Ronneberger et al., U-Net (2015) · Redmon et al., You Only Look Once (2015)
- Schroff et al., FaceNet (2015) · Mikolov et al., word2vec (2013)
- Bolukbasi et al., Debiasing Word Embeddings (2016)
- Bahdanau et al., Neural Machine Translation by Jointly Learning to Align and Translate (2014)
- Vaswani et al., Attention Is All You Need (2017)
- Sutton and Barto, Reinforcement Learning: An Introduction (2018) · Schulman et al., Proximal Policy Optimization (2017)
- Das et al., A decoder-only foundation model for time-series forecasting (2024)
- Karpathy, The Unreasonable Effectiveness of Recurrent Neural Networks (2015)