W3_A1_Ex-4_Wrong value for A2

I’m not able to understand what’s wrong with my code. It’s computing the value of A2 but there is a slight difference between the obtained and expected value of A2 (Attaching the screenshot for reference). Can someone help me what would have gone wrong.

Hello @Aryan.Singh
i found a similar post . You can check Week3 Assignment : AssertionError: Wrong values for A2

1 Like

Thanks for the reply
But, in my case i have used the correct activation functions unlike the issue that this person faced. My output has approx. the same output as required I’m not able to understand what could have caused such a minute deviation in my output

Please note that a difference in the 4th or 5th decimal place is not “minute”. It’s not a rounding error: it is some real logic error in your code. We’re doing 64 bit floating point here, so rounding errors will be on the order of 10^{-16}. E.g. did you omit the bias values in one of the layers? Something like that …

1 Like

Hi @Aryan.Singh ,
I think there’s something wrong with the formula in your code. Please double check it.
Screen Shot 2022-11-15 at 08.33.35

1 Like

Oh man, I made a very silly mistake in importing the value of b2 from the dictionary that caused this issue. Anyways thanks for the replies and @paulinpaloalto thanks for explaining the concept of rounding error, I’ll keep that in mind while solving the further programming assignments.

1 Like

It’s great to hear that you found the solution under your own power. Onward! :nerd_face:

2 Likes