I don’t understand where the expected dA0 comes from
my three code blocks I implemented were as follows.
First, initialize dAL
{moderator edit - solution code removed}
Then compute the gradients for the output layer L.
{moderator edit - solution code removed}
Then iterate through the previous layers.
{moderator edit - solution code removed}
I end up with the keys of grads being
dict_keys(['dA2', 'dW2', 'db2', 'dA1', 'dW1', 'db1'])
But the test is looking for
print("dA0 = " + str(grads['dA0']))
print("dA1 = " + str(grads['dA1']))
print("dW1 = " + str(grads['dW1']))
print("dW2 = " + str(grads['dW2']))
print("db1 = " + str(grads['db1']))
print("db2 = " + str(grads['db2']))
Where the numeric indices of the dAx values are off by one from the dWx and dbx values.
I’m figuring that I’m doing something really stupid, but can’t seem to see it.
Any help or hints?