C1 W3 Assignment nn_model W is not defined

I am unsure what I am doing wrong but my code for the nn_model in the assignment for week 3 keeps giving an error of “W is not defined”


Hi @JayOaks ,

Looking at the code here, I could not find W. So where could you get W and b to do the forward propagation? Remember, W and b are parameters, and there is a call to initialize_parameters() in you code.

Thank you, @Kic.

I am unsure if how I did it was the right way as the comment above says “~ 1 line of code” but since it worked and passed the test, it’s all okay.

Just to verify though, please, we are not limited by the number of lines of code mentioned in the comments/instructions, are we?

Thanks once again.

Hi @JayOaks ,

How many lines of code you write to produce the result is up to you, the suggested number is only a guide.
If your code work and passed the test, than, what causes the error output ?

Hi @Kic,

I no longer get the error.

The new code is longer than 1 line.

I kept trying to keep it to just 1 line and made the mistake.

But I changed it now.

Hi @JayOaks

Great to hear you have got it working.