Test failing with update Parameter with Adam function

This test is not passing, and I can’t detect the mistake. Here are my values and the expected results:

My results:

W1 =
[[ 1.65666861 -0.64411261 -0.5603075 ]
[-1.10430595 0.83327273 -2.26972811]]
W2 =
[[ 0.34890823 -0.28080038 1.49393381]
[-2.02926524 -0.29059994 -0.35198723]
[ 1.16555528 -1.09000828 -0.14009219]]
b1 =
[[ 1.77151876]
[-0.72903346]]
b2 =
[[-0.90730561]
[ 0.00960008]
[ 0.5508996 ]]

Expected results:

W1 = 
[[ 1.63942428 -0.6268425  -0.54320974]
 [-1.08782943  0.85036983 -2.2865723 ]]
W2 = 
[[ 0.33356139 -0.26425199  1.47707772]
 [-2.04538458 -0.30744933 -0.36903141]
 [ 1.14873036 -1.09256871 -0.15734651]]
b1 = 
[[ 1.75854357]
 [-0.74616067]]
b2 = 
[[-0.89228024]
 [ 0.02707193]
 [ 0.56782561]]

Any idea? What is going wrong. Also, new in this forum, so can you please tell me whether I can share my code in the forum? Thank you for helping.

Update: I found the bug and solved the issue

It’s great to hear that you found the problem under your own power. The most common errors here are to do with “order of operations” on the epsilon term: it needs to be in the denominator, but not under the square root, right?

In answer to your “policy” question, we are not supposed to share source code for problem solutions publicly. I realize that makes debugging a lot more difficult but those are supposed to be the rules. Of course, as you can see, a lot of people don’t obey those rules and there doesn’t seem to be much in the way of an enforcement mechanism. In the original Coursera Forums, the mentors had the ability to edit posts, but we can’t do that here. Or at least I have not figured out how to do it :nerd_face:

3 Likes