C1 - Week 4 - Exercise 9

Hi, I am getting the below IndexError in C1 - Week 4 - Exercise 9.

For Sigmoid, I have initialized the current cache as caches of L-1 and for Relu, I have initialized the current cache as caches of l.

Requesting your help. Thanks.

Error Trace:

Hi @trelango

Here when you call linear_activation_backward() you should send the the appropriate (index) grads[“dA”+ index ] as “dA” is an array so use for loop to choice appropriate index(loop over index) of grads[“dA”+ index] in grads dictionary

please feel free to ask any questions,
Thanks,
Abdelrahman

Hi @AbdElRhaman_Fakhry

Thanks a lot for your support. I had dAL instead of grads[“dA”+ index ]. It is fixed now.

On a different note, I also tried with dA_prev_temp (dA linear activation backward from sigmoid) - this also worked.

Thanks,

Elango