(rontolisp) docs
← Functions

torch:dropout

(torch:dropout p)

Returns a dropout layer (PyTorch's nn.Dropout) with drop probability p, in the single field :p. In training mode it zeroes each element with probability p and scales the survivors by 1 / (1 - p) (inverted dropout, so the expectation is unchanged); in evaluation mode (torch:eval) it is the identity, and so is p 0. The mask comes from the seeded linalg:seed generator, so a seeded training run reproduces on every backend.