S14 · Problem set 5
Problem set 5: network sizes and forward passes, softmax outputs, backpropagated gradients and gradient checks, learning rates and conditioning, momentum, Adam and minibatches, and convolutional layers
These problems cover lessons 24 to 28: counting parameters and operations, forward passes through tanh and ReLU units, softmax, gradients by backpropagation, vanishing gradients and finite-difference checks, stable and optimal learning rates, momentum, Adam's moments, minibatch noise, weight decay, dropout and convolutional layer arithmetic.
Check
A 16–32–10 network with biases, run on batches of 64.
(a)
Parameters?
(b)
Multiply-accumulates per batch?
Check
A one-input network with tanh hidden weights 0.4 and −0.8 and output weights 2.5 and 0.5; separately, softmax activations 0.5, −1, 0.
(a)
Network output at x = 0.5?
(b)
Softmax probability of the first class?
Check
with = 0.3, = 1.5, x = 2, target 1, squared error.
(a)
Error?
(b)
?
(c)
?
Check
with w = 0.5, b = 0.25, v = 3; input 1, target 2, squared error.
(a)
?
(b)
?
Check
Backward signals scaled by slope 0.25 and weight 1 per layer through 20 layers; a gradient check off by 0.0003; a 100000-weight network.
(a)
Overall gradient scale?
(b)
Central-difference error with the step divided by 2?
(c)
Forward passes for a central-difference gradient?
Check
A quadratic error with Hessian eigenvalues from 0.5 to 40.
(a)
Stability limit for η?
(b)
Best fixed η?
(c)
Factor per step at that η?
(d)
Factor per step with tuned momentum?
Check
Condition number 20, target reduction 0.0001.
(a)
Gradient-descent steps at the best rate?
(b)
With tuned momentum?
Check
Adam with β₁ = 0.9 and β₂ = 0.999, after 10 steps of constant gradient 0.5.
(a)
Uncorrected first moment m?
(b)
Uncorrected second moment v?
(c)
Ratio of the uncorrected step to the corrected one?
Check
Gradient noise 1 per example with batches of 32; dropout probability 0.4; weight decay λ = 0.001 at η = 0.05 for 40000 steps.
(a)
Minibatch gradient standard deviation?
(b)
Inverted-dropout scale?
(c)
Fraction of an unsupported weight left?
Check
A 3 × 3 convolution, padding 2, stride 2, from 3 channels to 16, on a 64 × 64 input.
(a)
Output width?
(b)
Parameters?
(c)
Multiply-accumulates?
Check
3 stacked 3 × 3 stride-1 layers; a fully connected layer mapping a 224 × 224 × 16 input to a 224 × 224 × 16 output.
(a)
Receptive field width?
(b)
Weights in the fully connected layer (no biases)?
(c)
How many times more than one 3 × 3 convolutional layer's weights?
Check
A one-input ReLU layer of 4 units; a sigmoid at a = −1.5; lesson 24's two-hinge network at the inputs (1.5, 1).
(a)
Maximum number of linear pieces?
(b)
σ′(a)?
(c)
Output at (1.5, 1)?
Check
A 5-million-parameter network trains for 30 epochs on 0.1 million examples, on hardware sustaining 0.35 of 300 TFLOP/s.
(a)
How much arithmetic does training take?
(b)
How many minutes does it take?
Check
A layer computes with , a = 2, b = 1, c = −2, d = 1, on x = (3, 2); the loss's gradient with respect to y is (1, 0.5).
(a)
What is , the weight from to ?
(b)
What is , the weight from to ?
(c)
What is ?
(d)
And ?
Check
A 3 × 3 convolution maps 64 channels to 512.
(a)
By what factor does a depthwise separable version cut its weights?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.