We'll give the start of the computation, computing the derivative of the loss function L with respect to z, or ∂ L ∂ z (and leaving the rest of the computation as an exercise for the reader). By the chain rule: