Skip to content
ML to LLMs
Learning path

Module 10

Neural-network foundations

Neurons, layers, weights, biases, activations, and tensor shapes, the building blocks of every deep model.

  1. 1. The neural-network forward passCompute a multilayer perceptron's output by hand, track every tensor shape, and see why nonlinear activations are what make depth useful.40 min
  2. 2. Loss functionsPick the right loss for regression, classification, imbalanced data, and embeddings, compute each one and its gradient by hand, and explain why cross-entropy beats squared error for classifiers.45 min
  3. 3. Intro to PyTorchBuild a tiny autograd engine, then use PyTorch tensors, autograd, nn.Module, and the five-line training loop to train a network on CPU, and recognize the bugs that loop invites.50 min

A neural network composes linear transformations with nonlinear activations. This module follows the numbers and shapes through a forward pass, then the loss that scores it, then PyTorch, the framework that turns both into a training loop.

#LessonYou will be able to
1The forward passcompute a small MLP's output by hand and check every shape
2Loss functionschoose and compute MSE, Huber, cross-entropy, focal, and contrastive losses, and explain why cross-entropy trains classifiers better than MSE
3Intro to PyTorchbuild a tiny autograd engine, then write a PyTorch training and evaluation loop on CPU

Interactive lab: Forward pass

Code: code/10-neural-networks/

Next moduleModule 11: Gradient descent and backpropagation