Zeros Initialization The first assignment of Improving Deep Neural Networks test fail

Hi

I am working to initialize to zeros by adding two lines of code to the for loop. I am reusing zeros intialization from the last course and getting an error for the second test assertion.
Anyone else passing first but not second test for W here? W2 is resulting in a error.

@Vortable Check if the zeros initialization from the previous course you’re referring to matches the dimension requirements of the current course. Sometimes, the structure or dimensional requirements change between courses, leading to unexpected errors.

2 Likes

This is probably not a good idea.

2 Likes

Please show us the error output that you are getting. What was the assertion that failed? That should shed some light on the nature of the error.

Thank you. Here is the error message:
AssertionError Traceback (most recent call last)
in
4 print("W2 = " + str(parameters[“W2”]))
5 print("b2 = " + str(parameters[“b2”]))
----> 6 initialize_parameters_zeros_test(initialize_parameters_zeros)

~/work/release/W1A1/public_tests.py in initialize_parameters_zeros_test(target)
33 ]
34
—> 35 multiple_test(test_cases, target)
36
37 def initialize_parameters_random_test(target):

/opt/conda/lib/python3.7/site-packages/dlai_tools/testing_utils.py in multiple_test(test_cases, target)
162 print(‘\033[91m’, len(test_cases) - success, " Tests failed")
163 raise AssertionError(
→ 164 “Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))

AssertionError: Not all tests were passed for initialize_parameters_zeros. Check your equations and avoid using global variables inside the function.

I adapted it. I used the same formula for zeros initialization is probably a better way to put it.

Thanks for the trace, but you left out the critical first line that actually shows the assertion. That’s what we need to see, right? The question is what does it not like.

If you don’t actually see the assertion, then we’ll probably need to actually look at your code, but we can’t do that in a public thread. Please check your DMs for a message from me about how to do that.

The problem is that you literally copied the “init” function from DLS C1 W4 A1 verbatim. But that does not initialize the W values with zeros …

We did it that way for “symmetry breaking”, but now what we are doing here is a concrete demonstration of why symmetry breaking is needed. We really set everything to zeros and then see that it won’t work.