inox.nn.dropout#
Dropout layers
Classes#
Creates a dropout layer. |
|
Creates a training-bound dropout layer. |
Descriptions#
- class inox.nn.dropout.Dropout(p=0.5)#
Creates a dropout layer.
\[y = \frac{m \odot x}{1 - p}\]where the binary mask \(m\) is drawn from a Bernoulli distribution such that \(P(m_i = 0) = p\). This has proven to be an effective technique for regularization and preventing overfitting.
References
A Simple Way to Prevent Neural Networks from Overfitting (Srivastava et al., 2014)
- class inox.nn.dropout.TrainingDropout(p=0.5)#
Creates a training-bound dropout layer.
When
self.training = False
,\[y = x\]See also
- __call__(x, key=None)#
- Parameters:
x (Array) – The input tensor \(x\), with shape \((*)\).
key (Array | None) – A PRNG key. If
None
,inox.random.get_rng
is used instead.
- Returns:
The output tensor \(y\), with shape \((*)\).
- Return type: