Dropout - 12 vs 13#
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.
- Dropout12 → Dropout13 +0 -1
Dropout12 → Dropout13
RENAMED
@@ -1 +1 @@
|
|
1
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
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
3
|
Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode,
|
4
4
|
the user can simply not pass training_mode input or set it to false.
|
5
5
|
::
|
6
6
|
output = scale * data * mask,
|
7
7
|
where
|
8
8
|
::
|
9
9
|
scale = 1. / (1. - ratio).
|
10
10
|
This operator has **optional** inputs/outputs. See ONNX <https://github.com/onnx/onnx/blob/master/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.
|
11
11
|
**Attributes**
|
12
12
|
* **seed**:
|
13
13
|
(Optional) Seed to the random generator, if not specified we will
|
14
14
|
auto generate one.
|
15
15
|
**Inputs**
|
16
16
|
Between 1 and 3 inputs.
|
17
17
|
* **data** (heterogeneous) - **T**:
|
18
18
|
The input data as Tensor.
|
19
19
|
* **ratio** (optional, heterogeneous) - **T1**:
|
20
20
|
The ratio of random dropout, with value in [0, 1). If this input was
|
21
21
|
not set, or if it was set to 0, the output would be a simple copy of
|
22
22
|
the input. If it's non-zero, output will be a random dropout of the
|
23
23
|
scaled input, which is typically the case during training. It is an
|
24
24
|
optional value, if not specified it will default to 0.5.
|
25
25
|
* **training_mode** (optional, heterogeneous) - **T2**:
|
26
26
|
If set to true then it indicates dropout is being used for training.
|
27
27
|
It is an optional value hence unless specified explicitly, it is
|
28
28
|
false. If it is false, ratio is ignored and the operation mimics
|
29
29
|
inference mode where nothing will be dropped from the input data and
|
30
30
|
if mask is requested as output it will contain all ones.
|
31
31
|
**Outputs**
|
32
32
|
Between 1 and 2 outputs.
|
33
33
|
* **output** (heterogeneous) - **T**:
|
34
34
|
The output.
|
35
35
|
* **mask** (optional, heterogeneous) - **T2**:
|
36
36
|
The output mask.
|
37
37
|
**Type Constraints**
|
38
38
|
* **T** in (
|
39
|
-
tensor(bfloat16),
|
40
39
|
tensor(double),
|
41
40
|
tensor(float),
|
42
41
|
tensor(float16)
|
43
42
|
):
|
44
43
|
Constrain input and output types to float tensors.
|
45
44
|
* **T1** in (
|
46
45
|
tensor(double),
|
47
46
|
tensor(float),
|
48
47
|
tensor(float16)
|
49
48
|
):
|
50
49
|
Constrain input 'ratio' types to float tensors.
|
51
50
|
* **T2** in (
|
52
51
|
tensor(bool)
|
53
52
|
):
|
54
53
|
Constrain output 'mask' types to boolean tensors.
|