The reverse-mode example is extended by inserting one hidden ReLU unit between the…
PHYSICS · Multi-part · Fermi University Physics · Computational Physics · High-performance and data-driven computational physics · High-performance and data-driven computational physics
Scientific Computing for Physicists, Ch Neural networks on physical data: backpropagation, convolution and symmetry
Problem
The reverse-mode example L=(wx+b−y)2 is extended by inserting one hidden ReLU unit between the input and the output. The computation graph is z1=w1x+b1,h=ReLU(z1),y^=w2h+b2,L=(y^−y)2, where x is the input, y the target, w1,b1,w2,b2 the four parameters, and ReLU(z)=max(0,z).
((a)) Starting from Lˉ=1, derive in order the adjoints y^ˉ, wˉ2, bˉ2, hˉ, zˉ1, wˉ1, bˉ1, using uˉ=∑v:u→vvˉ∂u∂v.
((b)) Evaluate every adjoint found in (a) numerically for x=1.5, y=1.0, w1=2.0, b1=−1.0, w2=0.5, b2=0.2.
((c)) Check wˉ1 by differentiating L directly with respect to w1 at the same point (note z1>0 there, so the ReLU is on its linear branch).