Deep Learning Fundamentals

Deep learning is fitting parameters of a layered, differentiable function so that it minimises a loss on a dataset. Everything else — backpropagation, optimisers, architectures, regularisation — is engineering on top of that core idea.

This page is what an engineer should know before training their first neural network, and what they should remember when training their hundredth.

The forward pass

A neural network is a chain of layers, each computing some function of its input plus learned parameters:

y = f_n(W_n, ... f_2(W_2, f_1(W_1, x)) ...)

Each layer typically does:

  1. A linear transformation: Wx + b.
  2. A non-linearity: ReLU, GeLU, sigmoid, tanh.

Without the non-linearity, stacked linear layers collapse to a single linear layer (linearity is closed under composition). The non-linearity is what lets deep networks represent functions that aren't linearly separable.

The loss function

A scalar that measures how wrong the network's prediction is for a given input/output pair. Standard choices:

The loss is what we minimise. Picking the right loss is more important than people assume; mismatched loss to task produces strange results.

Backpropagation

The chain rule applied to the loss as a function of the parameters. Working backwards from the loss:

Conceptually: each layer "knows" how its parameters and inputs contributed to the final loss. We update parameters to reduce that contribution.

Mechanically: every operation in the forward pass needs a corresponding "backward" rule that computes gradients. PyTorch / JAX / TensorFlow handle this automatically (autograd / autodiff) — you write the forward pass; the backward pass is derived.

Why depth helps

The universal approximation theorem says a single hidden layer (with enough units) can approximate any function. So why deep?

The "deep" in deep learning isn't ideological; it's empirical.

The loss landscape, briefly

The loss as a function of parameters is the loss landscape. Training is moving through this landscape, descending toward low-loss regions.

For deep networks:

You don't need to understand the geometry deeply to train networks. You do need to know that "training loss went up after I changed the LR" usually means you stepped out of the basin you were in.

What makes training work

The conditions for successful training:

Each "reasonable" hides the work. If training isn't converging, one of these is wrong.

Regularisation

Techniques to make networks generalise instead of memorising:

The right amount of regularisation is task-dependent. Too much underfits; too little overfits. Track training and validation loss; if they diverge, you need more regularisation; if they're both high, you need less or more capacity.

Overfitting and generalisation

Training loss low + test loss low = good model. Training loss low + test loss high = overfit. Training loss high + test loss high = underfit (architecture too small or training broken). Training loss high + test loss low = bug; test set is somehow easier than training; investigate.

The art is reading these signals and adjusting (more data, more regularisation, more capacity, different architecture) accordingly.

Why batch normalisation matters

Inside a deep network, activations at layer N depend on parameters of all earlier layers. If those parameters change during training, the distribution of inputs to layer N changes too — "internal covariate shift." Each layer is constantly chasing a moving target.

BatchNorm normalises activations to zero mean, unit variance, then learns a scale and shift. Stabilises the distribution; lets you train deeper networks at higher learning rates.

Variants: LayerNorm (across features per sample, used in transformers), GroupNorm (groups of channels, for small batch sizes), RMSNorm (LayerNorm without mean centering, increasingly common in LLMs).

Most deep architectures have some normalisation layer. The flavour matters less than its presence.

Data is the bottleneck

A common path:

Order of investments for a struggling deep learning project:

  1. More and better data.
  2. Better data preprocessing / augmentation.
  3. Better loss function / training objective.
  4. Better optimisation hyperparameters.
  5. Different / bigger architecture.

Most teams default to #5 first. It's usually the lowest-leverage change.

What you should know to read papers

To understand a typical deep learning paper:

Most deep learning papers are about one or two of these; the rest is from prior work. Understanding which novel piece they're proposing is the key skill.

What's not deep learning's strength

A starter pipeline

For someone training their first network:

  1. Pick a small, clean dataset with a clear metric.
  2. Start with a known-good architecture for that task. Don't design your own.
  3. Use a known-good optimiser with the recommended hyperparameters. AdamW, lr=1e-4 to 1e-3.
  4. Track training and validation loss. Plot. Look at them.
  5. Check what the model is doing: print confusion matrix, look at misclassified examples, examine outputs.
  6. Iterate based on what you see. If overfit, regularise; if underfit, more capacity / better data.

After this loop a few times, you have intuition. The intuition is what makes the engineering tractable.

Further reading