DropoutLayer#

class usencrypt.ai.nn.layers.DropoutLayer(rate=None, seed=None, _config=None)#

Applies dropout to the input.

Parameters
  • rate (float) – Value between 0 and 1 representing the fraction of the input units to drop.

  • seed (int) – The random seed.

Variables
  • rate (float) – Value between 0 and 1 representing the fraction of the input units to drop.

  • seed (int) – The random seed.

  • name (str) – The layer’s string identifier.

Inheritance

usencrypt.ai.nn.layers.Layer

Raises

ValueError – If rate is greater than 1 or less than 0.

Examples

Like all layers, the dropout layer can be added to the top of a neural network architecture stack as follows:

>>> import usencrypt as ue
>>> net = ue.ai.nn.NeuralNetwork()
>>> net.add(ue.ai.nn.layers.FCLayer(4, 3))
>>> net.add(ue.ai.nn.layers.DropoutLayer(rate=0.25))
>>> net.add(ue.ai.nn.layers.SoftmaxLayer())