loss.backward() dW = W.grad # Tells us "how much W must change to reduce the loss" dB = B.grad # and "how much B must change to reduce the loss"