Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2018/iii/paper-218/3/d/solution

For one observation, let and define . Differentiating the softmax function and its log-likelihood gives . The sigmoid-softmax network gradients are
These equations are backpropagation: use the chain rule through the output affine map, then through the hidden units, then the input affine map.
For a learning rate , select one observation and update every parameter by , computing all entries of the gradient from the old parameters before applying the update. A uniformly selected observation gives an unbiased gradient of the average log-likelihood; multiplying by 3000 would instead estimate the gradient of the sum. Equivalently perform stochastic gradient descent on the negative log-likelihood. Batch size one makes one update per observation, and five epochs make five passes through the data, typically with a fresh random ordering on each pass.

New to topics? Read the docs here!