Week 3 Exercise 4 forward_propagation AssertionError: Wrong values for A2

Hey! I’m having issues with sorting out the following error for Week 3, Exercise 4:

The resulting A2 vector that my code outputs is slightly different to the desired/correct A2 vector, and I’m unsure why. All previous exercises/tests worked.

For reference, this is how my forward_propagation is defined:
{mentor edit: code removed}

And this is how my initialize_paramters is defined:
{mentor edit: code removed}

This is my Lab ID: rlvjzxgkklhk

A quick response is very much appreciated, thank you.

Please do not post your code on the forum. That’s not allowed by the Code of Conduct. If a mentor needs to see your code, we’ll contact you with instructions.

Are you using the correct activation function?
image

2 Likes

Thanks for the quick response! And got it, I’ll make sure to not post any code in any future posts, thanks.

1 Like

Hello, I’m getting the same error. Not sure why:

Your A2 values are not correct.

Here are the expected values:
A2 = [[0.21292656 0.21274673 0.21295976]]

Check your code in forward_propagation() for how you are computing Z1, A1, Z2, and A2.

And also check how you are getting the weight and bias values from the parameters dictionary.

I chcked my code but I’m not sure which calculation is wrong

Posting solution code in a public topic goes against our Community Forum Code of Conduct. It’s okay to share stacktrace on a public post and send code to a mentor via direct message.

Please edit your post.

Here’s a guide on how to edit a post.

Hints:

Wrong variable here:
image

Also I recommend you remove the extra set of parenthesis around the outside of the Z1 and Z2 code. Those aren’t necessary (but probably do no harm).

Thank you for your help!! I didn’t realize I was passing the wrong variable

1 Like