3/31
Part 1 of 6 · Derive the two gradientsLearn and do

Read the two gradients off one entry of Y

One entry of Y is a row of A times a column of B

Start from one entry of the product, because both gradients fall out of it.

import torch

A = torch.tensor([[1., 2., 0.],
                  [0., 1., 3.]])
B = torch.tensor([[1., -1.],
                  [2.,  0.],
                  [0.,  1.]])
Y = A @ B
print(Y)
print(A[1] @ B[:, 0])
Predict

A is [[1, 2, 0], [0, 1, 3]], and B's first column is [1, 2, 0]. What is Y[1, 0], row 1 of A times column 0 of B?

Pick one to see what it prints.
Pick an answer above to see the rest