W4_A1_Ex2_Random values for W1 and W2

Note that it also looks like you changed the “seed” value in that code from 3 to 1. In the original template code for initialize_parameters_deep the seed value is 3. If you want to confirm that, you can get a clean copy of the assignment and compare. There is a topic about how to do that on the DLS FAQ Thread.

The only reason for setting the seed value here is so that you’ll get exactly the same answers from the random number generator, so that it’s easy for them to create the test case for functions like this. In a real system, you wouldn’t normally do that, because you want the values not to be predictable. Once you set the seed to a particular value, then the sequence you get is deterministic. But notice that means that you need to initialize the variables in exactly the right order. So W1 gets the first batch of “random” values and W2 gets the second batch and so forth. If you did it in the opposite order, you’d also get a different answer than the test case will check for.