Machine Learning Fundamentals · free preview

Gradient Descent and Minibatches

Most models are trained by iteratively stepping against the gradient of the loss, and the size of the batch used to estimate that gradient trades statistical precision for speed.

1. The algorithm that trains everything

The algorithm that trains everything

2. The gradient of the linear model

The gradient of the linear model

3. Full batch, single example, or something between

Full batch, single example, or something between

4. Hyperparameters

Hyperparameters

5. What the residual does to the gradient

In linear regression, the gradient contribution of example ii is x(i)(w⊤x(i)+b−y(i))\mathbf{x}^{(i)}(\mathbf{w}^\top\mathbf{x}^{(i)} + b - y^{(i)}). For an example whose prediction exactly equals its label, what happens on the next update?

6. The learning rate direction

The update rule is w←w−η∇wL\mathbf{w} \leftarrow \mathbf{w} - \eta \nabla_{\mathbf{w}}\mathcal{L}. With η=0.05\eta = 0.05 and a gradient component of +4+4 along one coordinate, that coordinate changes by ____ on the step.

Practice this interactively

Free account · instant grading · spaced review that schedules itself.

Start this course for free