Exercise 3 - initialize_parameters_he

Hello. I’m getting the following error when testing He initialization:

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

For W[l] paramters, I use np.full to create the array and fill it with np.sqrt of 2 / layers_dim[l-1]

For b[l] parameters, I use np.zeros and pass it layers_dim[l], and 1

For some reason, on the third test, something goes wrong:

Error: Wrong output for variable W1.
[[-0.03098412 -0.33744411 -0.92904268 0.62552248]] [[0.70710678 0.70710678 0.70710678 0.70710678]]
Error: Wrong output for variable W2.
2 Tests passed
1 Tests failed

For anyone who comes across this error, double-check the formula for He initialization. It was caused by a small implementation mistake.

Good luck with the rest of the specialization, @bulatao!

2 Likes