Implement Dropout Manually
Implement dropout as a function my_dropout(x, p)
:
- Zero out elements of
x
with probabilityp
. - Scale survivors by .
- Ensure deterministic behavior when
torch.manual_seed
is 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
.