Skip to content

Commit

Permalink
added unidirectional text for LayerNorm
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Eichenberger <[email protected]>
  • Loading branch information
AlexandreEichenberger committed Oct 19, 2023
1 parent 42b0662 commit c501444
Show file tree
Hide file tree
Showing 5 changed files with 696 additions and 3,736 deletions.
93 changes: 7 additions & 86 deletions docs/Changelog-ml.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ This version of the operator has been available since version 1 of the 'ai.onnx.
### <a name="ai.onnx.ml.FeatureVectorizer-1"></a>**ai.onnx.ml.FeatureVectorizer-1**</a>

Concatenates input tensors into one continuous output.<br>
All input shapes are 2-D and are concatenated along the second dimension. 1-D tensors are treated as [1,C].
All input shapes are 2-D and are concatenated along the second dimention. 1-D tensors are treated as [1,C].
Inputs are copied to the output maintaining the order of the input arguments.<br>
All inputs must be integers or floats, while the output will be all floating point values.

Expand Down Expand Up @@ -740,7 +740,7 @@ This version of the operator has been available since version 1 of the 'ai.onnx.
<dt><tt>nodes_hitrates</tt> : list of floats</dt>
<dd>Popularity of each node, used for performance and may be omitted.</dd>
<dt><tt>nodes_missing_value_tracks_true</tt> : list of ints</dt>
<dd>For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the 'true' or 'false' branch based on the value in this array.<br>This attribute may be left undefined, and the default value is false (0) for all nodes.</dd>
<dd>For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the 'true' or 'false' branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.</dd>
<dt><tt>nodes_modes</tt> : list of strings</dt>
<dd>The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of 'BRANCH_LEQ', 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', 'LEAF'</dd>
<dt><tt>nodes_nodeids</tt> : list of ints</dt>
Expand Down Expand Up @@ -813,7 +813,7 @@ This version of the operator has been available since version 1 of the 'ai.onnx.
<dt><tt>nodes_hitrates</tt> : list of floats</dt>
<dd>Popularity of each node, used for performance and may be omitted.</dd>
<dt><tt>nodes_missing_value_tracks_true</tt> : list of ints</dt>
<dd>For each node, define what to do in the presence of a NaN: use the 'true' (if the attribute value is 1) or 'false' (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the default value is false (0) for all nodes.</dd>
<dd>For each node, define what to do in the presence of a NaN: use the 'true' (if the attribute value is 1) or 'false' (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the defalt value is false (0) for all nodes.</dd>
<dt><tt>nodes_modes</tt> : list of strings</dt>
<dd>The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of 'BRANCH_LEQ', 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', 'LEAF'</dd>
<dt><tt>nodes_nodeids</tt> : list of ints</dt>
Expand Down Expand Up @@ -1018,7 +1018,7 @@ This version of the operator has been available since version 3 of the 'ai.onnx.
<dt><tt>nodes_hitrates_as_tensor</tt> : tensor</dt>
<dd>Popularity of each node, used for performance and may be omitted.</dd>
<dt><tt>nodes_missing_value_tracks_true</tt> : list of ints</dt>
<dd>For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the 'true' or 'false' branch based on the value in this array.<br>This attribute may be left undefined, and the default value is false (0) for all nodes.</dd>
<dd>For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the 'true' or 'false' branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.</dd>
<dt><tt>nodes_modes</tt> : list of strings</dt>
<dd>The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of 'BRANCH_LEQ', 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', 'LEAF'</dd>
<dt><tt>nodes_nodeids</tt> : list of ints</dt>
Expand Down Expand Up @@ -1085,9 +1085,9 @@ This version of the operator has been available since version 3 of the 'ai.onnx.
<dt><tt>aggregate_function</tt> : string (default is SUM)</dt>
<dd>Defines how to aggregate leaf values within a target. <br>One of 'AVERAGE,' 'SUM,' 'MIN,' 'MAX.'</dd>
<dt><tt>base_values</tt> : list of floats</dt>
<dd>Base values for regression, added to final prediction after applying aggregate_function; the size must be the same as the classes or can be left unassigned (assumed 0)</dd>
<dd>Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)</dd>
<dt><tt>base_values_as_tensor</tt> : tensor</dt>
<dd>Base values for regression, added to final prediction after applying aggregate_function; the size must be the same as the classes or can be left unassigned (assumed 0)</dd>
<dd>Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)</dd>
<dt><tt>n_targets</tt> : int</dt>
<dd>The total number of targets.</dd>
<dt><tt>nodes_falsenodeids</tt> : list of ints</dt>
Expand All @@ -1099,7 +1099,7 @@ This version of the operator has been available since version 3 of the 'ai.onnx.
<dt><tt>nodes_hitrates_as_tensor</tt> : tensor</dt>
<dd>Popularity of each node, used for performance and may be omitted.</dd>
<dt><tt>nodes_missing_value_tracks_true</tt> : list of ints</dt>
<dd>For each node, define what to do in the presence of a NaN: use the 'true' (if the attribute value is 1) or 'false' (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the default value is false (0) for all nodes.</dd>
<dd>For each node, define what to do in the presence of a NaN: use the 'true' (if the attribute value is 1) or 'false' (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the defalt value is false (0) for all nodes.</dd>
<dt><tt>nodes_modes</tt> : list of strings</dt>
<dd>The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of 'BRANCH_LEQ', 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', 'LEAF'</dd>
<dt><tt>nodes_nodeids</tt> : list of ints</dt>
Expand Down Expand Up @@ -1147,82 +1147,3 @@ This version of the operator has been available since version 3 of the 'ai.onnx.
<dd>The input type must be a tensor of a numeric type.</dd>
</dl>

## Version 4 of the 'ai.onnx.ml' operator set
### <a name="ai.onnx.ml.LabelEncoder-4"></a>**ai.onnx.ml.LabelEncoder-4**</a>

Maps each element in the input tensor to another value.<br>
The mapping is determined by the two parallel attributes, 'keys_*' and
'values_*' attribute. The i-th value in the specified 'keys_*' attribute
would be mapped to the i-th value in the specified 'values_*' attribute. It
implies that input's element type and the element type of the specified
'keys_*' should be identical while the output type is identical to the
specified 'values_*' attribute. Note that the 'keys_*' and 'values_*' attributes
must have the same length. If an input element can not be found in the
specified 'keys_*' attribute, the 'default_*' that matches the specified
'values_*' attribute may be used as its output value. The type of the 'default_*'
attribute must match the 'values_*' attribute chosen. <br>
Let's consider an example which maps a string tensor to an integer tensor.
Assume and 'keys_strings' is ["Amy", "Sally"], 'values_int64s' is [5, 6],
and 'default_int64' is '-1'. The input ["Dori", "Amy", "Amy", "Sally",
"Sally"] would be mapped to [-1, 5, 5, 6, 6].<br>
Since this operator is an one-to-one mapping, its input and output shapes
are the same. Notice that only one of 'keys_*'/'values_*' can be set.<br>
Float keys with value 'NaN' match any input 'NaN' value regardless of bit
value. If a key is repeated, the last key takes precedence.

#### Version

This version of the operator has been available since version 4 of the 'ai.onnx.ml' operator set.

#### Attributes

<dl>
<dt><tt>default_float</tt> : float (default is -0.0)</dt>
<dd>A float.</dd>
<dt><tt>default_int64</tt> : int (default is -1)</dt>
<dd>An integer.</dd>
<dt><tt>default_string</tt> : string (default is _Unused)</dt>
<dd>A string.</dd>
<dt><tt>default_tensor</tt> : tensor (default is {"_Unused"} if values_* has string type, {-1} if values_* has integral type, and {-0.f} if values_* has float type.)</dt>
<dd>A default tensor.</dd>
<dt><tt>keys_floats</tt> : list of floats</dt>
<dd>A list of floats.</dd>
<dt><tt>keys_int64s</tt> : list of ints</dt>
<dd>A list of ints.</dd>
<dt><tt>keys_strings</tt> : list of strings</dt>
<dd>A list of strings.</dd>
<dt><tt>keys_tensor</tt> : tensor</dt>
<dd>Keys encoded as a 1D tensor. One and only one of 'keys_*'s should be set.</dd>
<dt><tt>values_floats</tt> : list of floats</dt>
<dd>A list of floats.</dd>
<dt><tt>values_int64s</tt> : list of ints</dt>
<dd>A list of ints.</dd>
<dt><tt>values_strings</tt> : list of strings</dt>
<dd>A list of strings.</dd>
<dt><tt>values_tensor</tt> : tensor</dt>
<dd>Values encoded as a 1D tensor. One and only one of 'values_*'s should be set.</dd>
</dl>

#### Inputs

<dl>
<dt><tt>X</tt> : T1</dt>
<dd>Input data. It must have the same element type as the keys_* attribute set.</dd>
</dl>

#### Outputs

<dl>
<dt><tt>Y</tt> : T2</dt>
<dd>Output data. This tensor's element type is based on the values_* attribute set.</dd>
</dl>

#### Type Constraints

<dl>
<dt><tt>T1</tt> : tensor(string), tensor(int64), tensor(float), tensor(int32), tensor(int16), tensor(double)</dt>
<dd>The input type is a tensor of any shape.</dd>
<dt><tt>T2</tt> : tensor(string), tensor(int64), tensor(float), tensor(int32), tensor(int16), tensor(double)</dt>
<dd>Output type is determined by the specified 'values_*' attribute.</dd>
</dl>

Loading

0 comments on commit c501444

Please sign in to comment.