c20 · E2

Derive: Training Deep Networks Without Breaking Them

c20.E2.1E2 · expression

Consider momentum with coefficient : and . Without a spike the gradient is 1 at every step. At step 1 a spike adds to the gradient, so and for every .

Derive a closed form for . Show that the spike's contribution to is , and that this contribution decays geometrically. Then compute the excess velocity over the no-spike run after 5 steps and after 10 steps, for and , to four decimal places. Explain what the result says about reading a loss spike from the loss curve, connecting sections 20.5 and 20.6.

This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.

c20.E2.2E2 · expression

A linear layer has inputs and outputs. Its weights are independent with mean 0 and variance , its inputs are independent with mean 0 and variance , and the gradients arriving at its outputs are independent with mean 0 and variance .

Derive the factor by which the layer multiplies the variance in the forward direction, and the factor by which it multiplies the gradient variance in the backward direction. Show that no single makes both factors 1 unless . Then show that Xavier initialisation, , gives forward factor and backward factor , whose product is at most 1, with equality only when the two are equal. Compute , and for and .

This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.

c20.E2.3E2 · expression

A residual block computes output input branch(input), and the branch has local slope , so the block multiplies a gradient by .

(a) Show that the magnitude of the block factor is below 1 exactly when , equal to 1 at and at , and above 1 when or .

(b) A stack of 12 such blocks has in every block. Compute the factor per block and the magnitude of the product after 12 blocks, to six decimal places.

(c) Explain why this is an edge case for the claim that a skip connection prevents vanishing gradients, and say which value of makes every block an identity.

This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.

Other tiers

E1 Practise · E3 Open

Every hint opened, solution viewed and answer checked is recorded in this browser only. See Progress to export or delete it.