ML Katas

Implement Dropout Manually

medium (<1 hr) pytorch implementation dropout regularization
this month by E

Implement dropout as a function my_dropout(x, p):

  • Zero out elements of x with probability p.
  • Scale survivors by 1/(1p).
  • Ensure deterministic behavior when torch.manual_seed is set.

Compare with nn.Dropout.