oneflow.nn.functional¶
oneflow.nn.functional
Convolution functions¶
Applies a 1D convolution over an input signal composed of several input planes. |
|
Applies a 2D convolution over an input image composed of several input planes. |
|
Applies a 3D convolution over an input image composed of several input planes. |
|
Applies a 1D transposed convolution operator over an input signal composed of several input planes, sometimes also called “deconvolution”. |
|
Applies a 2D transposed convolution operator over an input image composed of several input planes, sometimes also called “deconvolution”. |
|
Applies a 3D transposed convolution operator over an input image composed of several input planes, sometimes also called “deconvolution”. |
|
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.nn.functional.fold.html. |
|
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.nn.functional.unfold.html. |
BatchNorm functions¶
Applies Batch Normalization for each channel across a batch of data. |
Pooling functions¶
Applies a 1D average pooling over an input signal composed of several input planes. |
|
Applies 2D average-pooling operation in \(kH \times kW\) regions by step size \(sH \times sW\) steps. |
|
Applies 3D average-pooling operation in \(kT \times kH \times kW\) regions by step size \(sT \times sH \times sW\) steps. |
|
Applies a 1D max pooling over an input signal composed of several input planes. |
|
Applies a 2D max pooling over an input signal composed of several input planes. |
|
Applies a 3D max pooling over an input signal composed of several input planes. |
|
Computes a partial inverse of |
|
Computes a partial inverse of |
|
Computes a partial inverse of |
|
Applies a 1D adaptive average pooling over an input signal composed of several input planes. |
|
Applies a 2D adaptive average pooling over an input signal composed of several input planes. |
|
Applies a 3D adaptive average pooling over an input signal composed of several input planes. |
|
Applies a 1D adaptive max pooling over an input signal composed of several input planes. |
|
Applies a 2D adaptive max pooling over an input signal composed of several input planes. |
|
Applies a 3D adaptive max pooling over an input signal composed of several input planes. |
Non-linear activation functions¶
Thresholds each element of the input Tensor. |
|
Applies the rectified linear unit function element-wise. |
|
Applies the HardTanh function element-wise. |
|
Applies the hardswish function, element-wise, as described in the paper: |
|
Applies the element-wise function \(\text{ReLU6}(x) = \min(\max(0,x), 6)\). |
|
Applies element-wise, |
|
Applies element-wise function |
|
Applies the element-wise function: |
|
Applies element-wise, :math:` ext{LeakyReLU}(x) = max(0, x) + ext{negative_slope} * min(0, x)` |
|
Applies the element-wise function: |
|
The equation is: |
|
Applies the Gaussian Error Linear Units function: |
|
Applies GELU approximation that is fast but somewhat inaccurate. |
|
Applies the element-wise function: |
|
Applies the hard shrinkage function in an element-wise manner. |
|
The formula is: |
|
Applies the element-wise function: |
|
Softmax is defined as: |
|
Applies the soft shrinkage function in an element-wise manner. |
|
LogSoftmax is defined as: |
|
Solve the problem that the output values of argmax do not reflect the probability distribution of the model’s output. |
|
The equation is: |
|
Applies the element-wise function \(\text{Sigmoid}(x) = \frac{1}{1 + \exp(-x)}\) |
|
Applies the element-wise function |
|
The formula is: |
|
Applies the element-wise function: |
|
Applies Layer Normalization for last certain number of dimensions. |
|
Performs \(L_p\) normalization of inputs over specified dimension |
Linear functions¶
Applies a linear transformation to the incoming data: \(y = xA^T + b\). |
Dropout functions¶
During training, randomly zeroes some of the elements of the input tensor with probability |
|
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.nn.functional.dropout1d.html. |
|
dropout1d(x: Tensor, p: float = 0.5, training: bool = True) -> Tensor |
|
dropout1d(x: Tensor, p: float = 0.5, training: bool = True) -> Tensor |
Distance functions¶
Returns cosine similarity between |
|
Computes the pairwise distance between vectors \(v_1\), \(v_2\) using the p-norm: |
Loss functions¶
The interface is consistent with TensorFlow. |
|
See |
|
The Connectionist Temporal Classification loss. |
|
This operator computes the L1 loss between each element in input and target. |
|
This operator computes the mean squared error (squared L2 norm) loss between each element in input and target. |
|
Function that uses a squared term if the absolute element-wise error falls below beta and an L1 term otherwise. |
|
Creates a criterion that measures the triplet loss given an input tensors \(x1\), \(x2\), \(x3\) and a margin with a value greater than \(0\). |
|
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.nn.functional.binary_cross_entropy.html. |
|
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.nn.functional.binary_cross_entropy_with_logits.html. |
Vision functions¶
Performs Deformable Convolution v2, described in Deformable ConvNets v2: More Deformable, Better Results if |
|
Pads tensor. |
|
The interface is consistent with PyTorch. |
|
alias of |
|
The interface is consistent with PyTorch. |
|
The interface is consistent with PyTorch. |
Greedy decoder¶
Performs greedy decoding on the logits given in input (best path). |