dropout(data, p=0.5, mode='training', axes=None, cudnn_off=False, **kwargs)

Applies dropout operation to input array.

  • During training, each element of the input is set to zero with probability p. The whole array is rescaled by \(1/(1-p)\) to keep the expected sum of the input unchanged.

  • During testing, this operator does not change the input if mode is ‘training’. If mode is ‘always’, the same computaion as during training will be applied.

  • data (NDArray) – Input array to which dropout will be applied.

  • p (float, optional, default=0.5) – Fraction of the input that gets dropped out during training time.

  • mode ({'always', 'training'},optional, default='training') – Whether to only turn on dropout during training or to also turn on for inference.

  • axes (Shape(tuple), optional, default=[]) – Axes for variational dropout kernel.

  • cudnn_off (boolean or None, optional, default=0) – Whether to turn off cudnn in dropout operator. This option is ignored if axes is specified.


out – The output of this function.

Return type

NDArray or list of NDArrays