Neural Networks and Deep Learning
Build neural networks from scratch in NumPy, right in your browser, then see the same models in PyTorch: CNNs, RNNs, attention and Transformers.
- 0 students
- 94 lessons
- 7 h 9 min
Created by Ayim Nelson
What you will learn
- Explain neurons, weights, biases and activation functions, and code a forward pass in NumPy
- Derive and check gradients with the chain rule and backpropagation
- Train a multilayer network with mini-batch gradient descent and read its training curve
- Fix networks that won't learn or that overfit: initialisation, learning rate, weight decay, dropout, early stopping, momentum and Adam
- Write PyTorch models, training loops and data loaders, and run them on a CPU, a GPU or in Colab
- Explain how convolutions, pooling and transfer learning work for images
- Use embeddings and cosine similarity, and explain RNNs, LSTMs, attention and the Transformer block
- Size up, save and responsibly use a deep learning model
About this course
This course opens the black box. You build a neural network one piece at a time in NumPy, in your browser: a neuron, layers, softmax, cross-entropy, backpropagation, gradient descent and a training loop, then the tricks that make training work (initialisation, weight decay, dropout, early stopping, momentum and Adam). Then you meet PyTorch, the framework used for real projects, and see every model again in it, with real output from a computer. The last part covers convolutional networks for crop photos, embeddings and RNNs for text, and the attention and Transformer blocks behind today's language models.
For: learners who have finished Machine Learning with scikit-learn (or know train/test splits, overfitting and logistic regression) and are comfortable with NumPy. No calculus is assumed: derivatives and the chain rule are explained from the start. You don't need a GPU.
By the end: you'll have trained a digit classifier you wrote yourself, built a tiny autograd, run convolution, attention and cosine-similarity search by hand, and you'll be able to read, write and debug PyTorch training code for CNNs, LSTMs, Transformers and transfer learning.
Course content
10 sections · 94 lessons
From models to neurons9 lessons
- What deep learning isPreviewReading · 3 min
- See it work firstPreviewReading · 3 min
- Logistic regression as a neuronPreviewReading · 3 min
- Weights and biasReading · 3 min
- The sigmoid activationReading · 3 min
- ReLU and other activationsReading · 3 min
- A neuron in NumPyReading · 3 min
- Why one neuron isn't enough (XOR)Reading · 4 min
- Code a neuronExercise · 10 min
Layers and the forward pass8 lessons
- Matrices of weightsReading · 3 min
- A hidden layerReading · 3 min
- The forward passReading · 3 min
- Solving XOR with a hidden layerReading · 3 min
- Softmax for many classesReading · 3 min
- Shapes and broadcastingReading · 4 min
- Batches: many examples at onceReading · 3 min
- Forward pass for digitsExercise · 12 min
Loss and gradients9 lessons
- Loss functionsReading · 3 min
- Cross-entropyReading · 4 min
- Derivatives, plainlyReading · 3 min
- GradientsReading · 3 min
- The chain ruleReading · 4 min
- Backpropagation for one neuronReading · 4 min
- Backpropagation step by stepReading · 4 min
- Checking gradients numericallyReading · 3 min
- Backprop by handExercise · 15 min
Training a network6 lessons
- The gradient descent loopReading · 4 min
- The learning rateReading · 4 min
- Mini-batches and epochsReading · 4 min
- Training curves as numbersReading · 4 min
- Train a digit classifier from scratchReading · 4 min
- Reach 90% on digitsExercise · 15 min
Making training work10 lessons
- InitialisationReading · 4 min
- Vanishing and exploding signalsReading · 4 min
- Overfitting in networksReading · 3 min
- Weight decay (L2 regularisation)Reading · 4 min
- DropoutReading · 4 min
- Early stoppingReading · 3 min
- MomentumReading · 4 min
- AdamReading · 4 min
- Batch normalisation (idea)Reading · 3 min
- Fix a network that won't learnExercise · 12 min
PyTorch, on your computer13 lessons
- Why PyTorchReading · 3 min
- Installing PyTorchReading · 3 min
- TensorsReading · 3 min
- autogradReading · 4 min
- Layers with nn.ModuleReading · 4 min
- Losses and optimisersReading · 3 min
- A training loop in PyTorchReading · 4 min
- Datasets and DataLoaderReading · 4 min
- GPUs and devicesReading · 4 min
- Google ColabReading · 3 min
- Your digit network in PyTorchReading · 4 min
- NumPy and PyTorch side by sideReading · 3 min
- Build a tiny autogradExercise · 15 min
Convolutional networks12 lessons
- Images as arraysReading · 3 min
- Why not a dense layer for images?Reading · 3 min
- Convolution by handReading · 4 min
- Filters and feature mapsReading · 4 min
- Stride and paddingReading · 4 min
- Channels and many filtersReading · 4 min
- PoolingReading · 3 min
- Leaf photos for a CNNReading · 3 min
- A small CNN in PyTorchReading · 4 min
- Transfer learningReading · 3 min
- Transfer learning in PyTorchReading · 4 min
- Hand-run a 3x3 filterExercise · 12 min
Sequences and embeddings9 lessons
- Text as numbersReading · 3 min
- One-hot vectorsReading · 3 min
- EmbeddingsReading · 3 min
- Cosine similarityReading · 3 min
- Word vectors and similarityReading · 4 min
- RNNs: networks with memoryReading · 4 min
- Why RNNs forgetReading · 3 min
- LSTMs and GRUsReading · 4 min
- Nearest words with cosine similarityExercise · 12 min
Attention and Transformers10 lessons
- The attention ideaReading · 3 min
- Queries, keys and valuesReading · 4 min
- Scaled dot-product attentionReading · 4 min
- Causal maskingReading · 4 min
- Multi-head attentionReading · 4 min
- Positional encodingReading · 4 min
- The Transformer blockReading · 4 min
- A Transformer in PyTorchReading · 4 min
- From Transformers to language modelsReading · 3 min
- Self-attention on 4 tokensExercise · 15 min
Deep learning in practice8 lessons
- Saving and loading modelsReading · 4 min
- Counting parameters and memoryReading · 3 min
- Compute and costReading · 3 min
- Debugging a networkReading · 4 min
- Ethics: images, consent and deepfakesReading · 4 min
- Where to go nextReading · 3 min
- Size up a modelExercise · 10 min
- Final quizQuiz · 10 min
Reviews
No reviews yet.
Comments
Log in to join the conversation.
Loading comments...