Dropout - 7 vs 22

Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.

Files changed (1) hide show
  1. Dropout7 → Dropout22 +29 -10
Dropout7 → Dropout22 RENAMED
@@ -1 +1 @@
1
- Dropout takes one input data (Tensor<float>) and produces two Tensor outputs,
1
+ Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs,
2
- output (Tensor<float>) and mask (Tensor<bool>). Depending on whether it is in
2
+ output (floating-point tensor) and mask (optional Tensor<bool>). If training_mode is true then the output Y will be a random dropout;
3
- test mode or not, the output Y will either be a random dropout, or a simple
3
+ Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode,
4
- copy of the input. Note that our implementation of Dropout does scaling in
5
- the training phase, so during testing nothing needs to be done.
4
+ the user can simply not pass training_mode input or set it to false.
5
+
6
+ output = scale * data * mask,
7
+
8
+ where
9
+
10
+ scale = 1. / (1. - ratio).
11
+
6
12
  This operator has **optional** inputs/outputs. See [ONNX IR](https://github.com/onnx/onnx/blob/main/docs/IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.
7
13
  ### Attributes
8
- * **ratio - FLOAT** (default is '0.5'):
14
+ * **seed - INT** :
9
- The ratio of random dropout
15
+ (Optional) Seed to the random generator, if not specified we will auto generate one.
10
16
  ### Inputs
17
+
18
+ Between 1 and 3 inputs.
11
19
  - **data** (heterogeneous) - **T**:
12
20
  The input data as Tensor.
21
+ - **ratio** (optional, heterogeneous) - **T1**:
22
+
23
+ The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it's non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.
24
+ - **training_mode** (optional, heterogeneous) - **T2**:
25
+
26
+ If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.
13
27
  ### Outputs
14
28
  Between 1 and 2 outputs.
15
29
  - **output** (heterogeneous) - **T**:
16
30
  The output.
17
- - **mask** (optional, heterogeneous) - **T**:
31
+ - **mask** (optional, heterogeneous) - **T2**:
18
32
  The output mask.
19
33
  ### Type Constraints
20
- * **T** in ( tensor(double), tensor(float), tensor(float16) ):
34
+ * **T** in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz) ):
35
+ * **T1** in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz) ):
36
+
21
- Constrain input and output types to float tensors.+ Constrain input and output types to float tensors.
37
+ Constrain input 'ratio' types to float tensors.
38
+ * **T2** in ( tensor(bool) ):
39
+
40
+ Constrain output 'mask' types to boolean tensors.