Tensor
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 2 | Copy constructor. Removes the derivatives and actions. |
| Transpose | 1 | Transpose the last two dimensions |
| Scale | 1 | Scale all elements with a number |
| Add | 1 | Add a number to all elements |
| Pow | 1 | Element-wise power |
| GenerateNormalRandomValues | 1 | Generate normal random values with He scaling over the second last dimension of the tensor. |
| Softmax | 1 | Softmax over last dimension |
| Mask | 1 | Mask upper triangular part of the last two dimensions of a tensor |
| Dropout | 1 | Zero out elemens of the last dimension of a tensor based on a masking array |
| ReLU | 1 | Set all elements |
| Flatten | 1 | Flatten last two dimensions. |
| GetMaxIndex | 1 | Only used for final output layer |
| VecAdd | 1 | Add a vector to the last dimension of the matrix |
| MatAdd | 2 | Element-wise addition of the elemens of two tensors with identical shape |
| ClearDerivatives | 1 | Remove derivatives and derivative actions |
| GetDerivatives | 1 | Extract derivatives of a tensor and return as a new tensor |
| TransferDerivatives | 1 | Perform derivative calculations for all elements in a tensor with input values from the derivatives of another tensor with the same shape |
| MatDivElementWise | 1 | Element-wise division of the elemens of two tensors with identical shape |
| MatMulElementWise | 1 | Element-wise multiplication of the elemens of two tensors with identical shape |
| MatMul | 1 | Matrix multiplication over the last two dimensions of two tensors |
| Concat | 1 | Concatenate an array of tensors of identical shape along its last dimension |
| AddNorm | 1 | Add two tensors and normalize over last dimension |
| ToString | 1 | |
| op_Multiply | 1 | |
| op_Division | 1 | |
| op_Addition | 1 | |
| op_Subtraction | 1 |
03 Properties
04 Fields
| Name | Overloads | Summary |
|---|---|---|
| sizes | 1 | dimension size |
05 Members
Int32())Constructor
| Name | Type | Description |
|---|---|---|
sizes | Int32() | - |
Boolean)Copy constructor. Removes the derivatives and actions.
| Name | Type | Description |
|---|---|---|
T | Tensor | - |
Transpose the last two dimensions
Double)Scale all elements with a number
| Name | Type | Description |
|---|---|---|
s | Double | - |
Double)Add a number to all elements
| Name | Type | Description |
|---|---|---|
s | Double | - |
Double)Element-wise power
| Name | Type | Description |
|---|---|---|
e | Double | - |
Generate normal random values with He scaling over the second last dimension of the tensor.
Softmax over last dimension
Mask upper triangular part of the last two dimensions of a tensor
Boolean(), Double)Zero out elemens of the last dimension of a tensor based on a masking array
| Name | Type | Description |
|---|---|---|
dropoutMask | Boolean() | - |
Set all elements
Flatten last two dimensions.
Only used for final output layer
Add a vector to the last dimension of the matrix
| Name | Type | Description |
|---|---|---|
v | Tensor | - |
In place element-wise addition of the elemens of two tensors with identical shape. Only used for optimizer.
| Name | Type | Description |
|---|---|---|
T | Tensor | - |
Element-wise addition of the elemens of two tensors with identical shape
Remove derivatives and derivative actions
Extract derivatives of a tensor and return as a new tensor
Perform derivative calculations for all elements in a tensor with input values from the derivatives of another tensor with the same shape
| Name | Type | Description |
|---|---|---|
T | Tensor | - |
Element-wise division of the elemens of two tensors with identical shape
Element-wise multiplication of the elemens of two tensors with identical shape
Matrix multiplication over the last two dimensions of two tensors
Concatenate an array of tensors of identical shape along its last dimension
| Name | Type | Description |
|---|---|---|
Tensors | Tensor() | - |
Add two tensors and normalize over last dimension
Int32())Index parameter implementation
| Name | Type | Description |
|---|---|---|
keys | Int32() | - |
Int32)Index parameter implementation
Int32, Int32)Index parameter implementation
Int32, Int32, Int32)Index parameter implementation
dimension size