Course 1, Week 3, Assignment, Random Initialization err

My code on the Coursera Course site, using the same random seed (‘2’), gives a different set of W1 and W2 than the expected values. I changed the random seed to different values but could not obtain the same values presented by the ‘test’ problem (see below screenshot of the err). I then recreated the assignment (including downloading the test set script) to my local Jupyter Lab (version 3.0.16). The same test passed. Any suggestion? I hesitate to continue for the rest of the assignment on Coursera because my random weights will be different from what are expected. I expect that this will propagate throughout the rest of the calls.

I completed this assignment and ignored errors due to incorrect initial W1 and W2 as identified by the tests. My final model appears correct with an in-sample prediction accuracy of 91% for n_h=4

image

It looks like you forgot to multiply by 0.01 in the initialization routine. They wrote the correct code for you in the instructions. Please compare your code to what they show.

You’re right, Paul. After I multiplied W1 and W2 by 0.01, the test passed without errors. Thanks,