Implement Dropout Manually
Implement dropout as a function my_dropout(x, p):
- Zero out elements of
xwith probabilityp. - Scale survivors by .
- Ensure deterministic behavior when
torch.manual_seedis set.
Compare with nn.Dropout.
Implement dropout as a function my_dropout(x, p):
x with probability p.torch.manual_seed is set.Compare with nn.Dropout.