13/32
Part 3 of 6 · The loss and its gradientLearn and do

Do the softmax and the log as one step, and nothing divides by zero

You could run the log's backward and then the softmax's backward, one at a time. The math is the same. But the log's backward divides by pcp_c, the label's probability, and that can be 0:

p_c = np.exp(-800.0)
print(p_c, -1 / p_c, -1 / p_c * p_c)
Predict

p_c = np.exp(-800.0). What do p_c, -1 / p_c and -1 / p_c * p_c print?

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