Dropout (Srivastava et al., 2014, following Hinton et al., 2012) fights overfitting by randomly switching off units during training. Each unit is kept with probability 1 - p and dropped with probability p. Without correction, the next layer would see activations that are too small on average, so the survivors are scaled up. This question implements that forward pass.
Implement dropout_forward(x, keep_mask, p). It multiplies x by the mask and rescales by 1 / (1 - p). The signature and docstring are already in the editor.
keep_mask has the same shape as x and holds 0s and 1s.0 <= p < 1.Multiply element-wise by the mask first, then divide by 1 - p.
No results yet
Run your code to check it against the examples, or submit to run every test.