mindspore.ops.Dropout

class mindspore.ops.Dropout(keep_prob=0.5, Seed0=0, Seed1=0)[source]

During training, randomly zeroes some of the elements of the input tensor with probability 1-keep_prob from a Bernoulli distribution. It plays the role of reducing neuron correlation and avoid overfitting.

Refer to mindspore.ops.dropout() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> dropout = ops.Dropout3D(keep_prob=0.5)
>>> x = Tensor(np.ones([1, 2, 3, 4, 5]), mindspore.float32)
>>> output, mask = dropout(x)
>>> print(output.shape)
(1, 2, 3, 4, 5)