DLS Course 1 Week 4 Exercise 5 - L_model_forward

I am getting below error ,



Moderator Edit: Solution Code Removed.

please help me to resolve this issue

Thank you verymuch

1 Like

First, please note that sharing your code is not allowed by the community code of conduct. Second, what is the representation of the last layer (where you applied sigmoid)? Is it l or L?

1 Like

it is variable l ,

next onwards i never share code

1 Like

No, it’s not l. Think about it. We use sigmoid for the last layer, right? So, how we represent the last layer? Hint: Check the range of for loop.

1 Like

#AL, cache =linear_activation_forward(A_prev,parameters[‘W’ +
str(L)],parameters[‘b’ + str(L)], activation=‘sigmoid’)

but after using L ,
iam getting beow error

1 Like

Please share full error.

1 Like


You are still making a mistake. For the last layer, the input is the “output of the previous layer” (the last hidden layer), right? But how we are denoting it in a code? It’s not A_prev.

1 Like

done…Thank you very much saif ji

1 Like

Good to know…

1 Like