DLS Course 1 Week 4_ exercise 9_ L_model_backward

I am getting below error ,please help to resolve.



please

Hi Suman,

In the L_model_backward Cache index is not correct as the layer range is L-2 to 0.

hi ,
#current_cache =caches[l-2]

#dA_prev_temp, dW_temp, db_temp=linear_activation_backward(dA_prev_temp, current_cache, activation=‘relu’)

I have tried different caches indices ,like l,l-1,l-2,l-3,l+1,l+2

still i am getting errors

Your current cache is wrong. Read the below hint, given in the notebook, carefully:

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])
    

#current_cache =caches[l]

#dA_prev_temp, dW_temp, db_temp=linear_activation_backward(dA_prev_temp, current_cache, activation=‘relu’)

still iam getting error .

iam not able to understand

Your arguments to the linear_activation_backward is not correct. All the instructions given to you are very clear. Read them carefully.

# lth layer: (RELU -> LINEAR) gradients.
# Inputs: "grads["dA" + str(l + 1)], current_cache". Outputs: "grads["dA" + str(l)] , grads["dW" + str(l + 1)] , grads["db" + str(l + 1)] 
#(approx. 5 lines)
# current_cache = ...
# dA_prev_temp, dW_temp, db_temp = ...
# grads["dA" + str(l)] = ...
# grads["dW" + str(l + 1)] = ...
# grads["db" + str(l + 1)] = ...