I.14.X06Backpropagation through one graph convolution
gradient▲▲△Derive the gradients of a loss L with respect to W and H
for the linear layer Y=A^HW, given
G=∂L/∂Y. Then evaluate them for the paw
graph with scalar features x=(1,2,3,4), weight w=0.5, target
t=(0,0,1,1) and L=21∥y−t∥2.
Hint
Treat A^H as one matrix and use the chain rule for matrix
products (The chain rule for matrix products · 0.MC.07). A^ is symmetric.
Solution
With Z=A^H, Y=ZW, so
∂L/∂W=ZTG=(A^H)TG
and ∂L/∂Z=GWT. Then
∂L/∂H=A^TGWT=A^GWT.
The backward pass through a graph convolution is another graph
convolution, applied to the gradients: each node receives a degree-weighted
average of its neighbours’ errors.
For the numbers, A^x=(1.866025,1.866025,
3.030239,3.060660) from I.14.B01, so
y=(0.933013,0.933013,1.515119,1.530330),the residual is y−t=(0.933013,0.933013,
0.515119,0.530330), and
L=1.143812. The weight’s gradient is the dot product of
A^x with the residual, 6.666146. The input’s gradient is
0.5A^(y−t)=(0.385355,0.385355,
0.427478,0.223644).
Nodes 1 and 2 receive the same gradient, as they produced the same
output: one layer cannot tell them apart in either direction. The script
confirms all five derivatives by central finite differences.