I worked through the logic and couldn’t find anything wrong, and the error message suggests it could be a variable declaration issue? But the variable “linear_cache” is already declared for us, and I suppose we shouldn’t touch the code not inside the blanks?
I suspect it might be a tiny issue I overlooked, but I have spent a whole day and couldn’t figure it out. Could anyone offer some help?
I know the error says the second input into sigmoid_backward is a tuple and it cannot be negated. I think I can somehow modify the tuple into a list, but the instruction specifically tell us how to use the sigmoid_backward function and “activation_cache” is a tuple. How can I work around this?
Your current_cache is not correct. What should be the current_cache for sigmoid? The answer is in the notebook. Read below lines again:
caches -- list of caches containing:
every cache of linear_activation_forward() with "relu" (it's caches[l], for l in range(L-1) i.e l = 0...L-2)
the cache of linear_activation_forward() with "sigmoid" (it's caches[L-1])