Dropout

Description

Uses an input float tensor alongside two optional inputs: a ratio (float scalar) and a training_mode (bool scalar). It generates a float output tensor and an optional output mask. If training_mode is set to true, the output Y undergoes a random dropout process. The operator automatically scales the mask data according to the Dropout formula. Therefore, to convert the trained model to the inference mode, you can either omit the input data or set training_mode to false.

Input

  • data: input tensor of type float16 or float.
  • ratio (optional): random Dropout ratio. The value range is [0, 1). The default value is 0.5. The data type can be float16 or float.
  • training_mode (optional): If set to true, Dropout is being used for training. Unless otherwise specified, the value is false. If it is false, ratio is ignored and the operation simulates the inference mode. In this mode, no content is deleted from the input data. If the mask is requested as the output, it contains all 1s. The data type is bool.

Output

  • output: output tensor of the identical data type as the input.
  • mask (optional): output tensor of type bool, specifying the output mask.

Constraints

None.

ONNX Opset Support

Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18