March 2020
Beginner to intermediate
342 pages
8h 38m
English
In Fearful Symmetry, we learned that we shouldn’t initialize all the neural network’s weights to the same value. See for youself what happens if we ignore that advice.
You can use NumPy’s zeros function to initialize all the weights to 0. For example, here is how you get a matrix of zeros with two rows and three columns:
| => | np.zeros((2, 3)) |
| <= | array([[ 0., 0., 0.], |
| | [ 0., 0., 0.]]) |
The parameter to zeros has its own parentheses, because it’s a tuple—an immutable collection of values. (For more about tuples, read Collections.) In this case, the tuple has two values, that are the rows and columns of the matrix, respectively.
After you initialize the weights to zero, run the network for a few iterations, and see ...
Read now
Unlock full access