Six tanh Layers and a Shrinking Gradient

Mixed: Chain Rule & Vanishing GradientsHard+30 XP+30

Six tanh Layers and a Shrinking Gradient

A network stacks six identical layers. For k=1,…,6k = 1, \dots, 6k=1,…,6, layer kkk computes

ak=tanh⁡(zk),zk=w ak−1,w=1.25a_k = \tanh(z_k), \qquad z_k = w\,a_{k-1}, \qquad w = 1.25ak​=tanh(zk​),zk​=wak−1​,w=1.25

and the same weight www is shared by every layer. During one backward pass it happens that tanh⁡(zk)=0.6\tanh(z_k) = 0.6tanh(zk​)=0.6 at every layer. Recall that

ddztanh⁡(z)=1−tanh⁡2(z)\frac{d}{dz}\tanh(z) = 1 - \tanh^2(z)dzd​tanh(z)=1−tanh2(z)

The gradient arriving from the loss at the top of the stack is ∂L∂a6=5\dfrac{\partial L}{\partial a_6} = 5∂a6​∂L​=5.

What is ∂L∂a0\dfrac{\partial L}{\partial a_0}∂a0​∂L​?

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

Select all that apply.