liveBook · Manning

Training

As explained in Inside Deep Learning: Math, Algorithms, Models

The process of fitting a model's parameters on data to improve performance on a task.

Training fits a model's parameters Θ by minimizing loss over labeled examples. With inputs x, labels y, and predictions ŷ = fΘ(x), the objective is minΘ Σᵢ ℓ(fΘ(xᵢ), yᵢ). section 2.1.1

Gradient descent changes Θ to reduce the loss; PyTorch tracks tensor operations and computes the gradients needed for this update. section 2.1.1 section 1.7

def F(X, y, f, theta): 
   total_loss = 0 
   for i in range(N): 
       total_loss += loss(f(X[i,:], theta), y[i]) 
   return total_loss

A compact loop-style listing maps the summation in the training objective to accumulated loss over input–label pairs. section 2.1.1

Training choices can be tested empirically:

  • Run CNNs for 40 rather than 10 epochs and observe the effect. section 3.7
  • Train CIFAR10 models while varying convolution layers, pooling, filters, and image transforms. section 3.7

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Defines notation and the loss-minimization objective, then connects minimization to gradient descent and automatic differentiation.
Examples
Uses CNN experiments with CIFAR10 and MNIST, varying epochs, layers, pooling, filters, and image transforms.
What it assumes
Assumes inputs, labels, predictions, and models; establishes the notation and optimization framing needed to follow training.
What you can do after
Apply it via PyTorch by computing loss, obtaining gradients, updating parameters, and comparing experimental model choices.
How it connects
Connects neural networks, parameters, loss functions, gradient descent, automatic differentiation, tensors, datasets, and GPUs.

Also explained in

Compare how 24 books explain training →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.