Computing dK by hand

For each entry of the 2×2 filter gradient, the loop visits every cell of dconv (even the zeros), multiplies it by the matching cell of X, and adds up the products: dK[a][d] = Σ dconv[i][j] · X[i+a][j+d].

Compute:

Worked example: ReLU-masked, max-pool-routed gradient dconv (4×4) and input X (5×5) from the Backpropagation for CNNs worksheet. Expected result: dK = [[0.207, 0.207], [0.276, 0.414]].