Week 4 -Exercise 4

I am getting below error,
AssertionError: Not all tests were passed for linear_activation_backward. Check your equations and avoid using global variables inside the function.

Code :

if activation == “relu”:
#(≈ 2 lines of code)
# dZ = …
# dA_prev, dW, db = …
# YOUR CODE STARTS HERE
dZ=sigmoid_backward(dA, activation_cache)
dA_prev,dW,db =linear_backward(dZ, linear_cache)

What will be the issue ? am not able to understand .

Hi @Chinchu ,
Please take a look at the if statement and you will see what is wrong. The if expression statement is not consistent with the if execution statement.

1 Like

Hi Carlosrl,

Thank you so much , that was mistake from my side . Its worked now.