When I’m trying to execute my function on initialize_parameters_test it’s giving me an AssertionError: Wrong values for W1
error. I declared the W1 with np.random.randn(a,b) * 0.01
using suitable a and b for its place of course. When I took a look at public_tests.py I found the expected value for W1 on the test is expected W1 = [[-0.00416758, -0.00056267, -0.02136196],[ 0.01640271, -0.01793436, -0.00841747],[ 0.00502881, -0.01245288, -0.01057952],[-0.00909008, 0.00551454, 0.02292208],[ 0.00041539, -0.01117925, 0.00539058]]
but when I print in the initialize_parameters function it’s giving me printed W1 = [[0.00435995 0.00025926 0.00549662], [0.00435322 0.00420368 0.00330335], [0.00204649 0.00619271 0.00299655], [0.00266827 0.00621134 0.00529142], [0.0013458 0.00513578 0.0018444 ]]
. As I mentioned earlier, I declared the W1 in the way given in the instructions. What am I doing wrong here or is there any chance the W1 in public_tests.py is outdated?
2 Likes
Notice that all your values are positive, but the expected values are both positive and negative. What that probably means is that you did not copy the code correctly. You must have used rand
instead of randn
. That little “n” there makes a big difference.
3 Likes
oh yes that was the problem thanks for the quick reply