Once a mask is chosen, the sparse network is just the original weights with the pruned entries forced to zero. The paper's key step is to reset the kept weights to their initial values, which this question does not do yet.
Implement apply_mask(w, mask), which zeros the weights where the mask is False.
mask is boolean and matches the shape of w.Multiply element-wise, letting False become 0.
No results yet
Run your code to check it against the examples, or submit to run every test.