Package apple.mlcompute.enums
Class MLCActivationType
- java.lang.Object
-
- apple.mlcompute.enums.MLCActivationType
-
public final class MLCActivationType extends java.lang.Object[@enum] MLCActivationType An activation type that you specify for an activation descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description static intAbsoluteThe absolute activation type.static intCELUThe CELU activation type.static intClampThe clamp activation type.static intCountMust be laststatic intELUThe parametric ELU activation type.static intGELUThe GELU activation type.static intHardShrinkThe hard shrink activation type.static intHardSigmoidThe hard sigmoid activation type.static intHardSwishThe hardswish activation type.static intLinearThe linear activation type.static intLogSigmoidThe log sigmoid activation type.static intNoneThe identity activation type.static intReLUThe ReLU activation type.static intReLUNThe ReLUN activation type.static intSELUThe SELU activation type.static intSigmoidThe sigmoid activation type.static intSoftPlusThe parametric soft plus activation type.static intSoftShrinkThe soft shrink activation type.static intSoftSignThe parametric soft sign activation type.static intTanhThe hyperbolic tangent (TanH) activation type.static intTanhShrinkThe hyperbolic tangent (TanH) shrink activation type.static intThresholdThe threshold activation type.
-
-
-
Field Detail
-
None
public static final int None
The identity activation type.- See Also:
- Constant Field Values
-
ReLU
public static final int ReLU
The ReLU activation type. This activation type implements the following function: \code f(x) = x >= 0 ? x : a * x \endcode- See Also:
- Constant Field Values
-
Linear
public static final int Linear
The linear activation type. This activation type implements the following function: \code f(x) = a * x + b \endcode- See Also:
- Constant Field Values
-
Sigmoid
public static final int Sigmoid
The sigmoid activation type. This activation type implements the following function: \code f(x) = 1 / (1 + e⁻ˣ) \endcode- See Also:
- Constant Field Values
-
HardSigmoid
public static final int HardSigmoid
The hard sigmoid activation type. This activation type implements the following function: \code f(x) = clamp((x * a) + b, 0, 1) \endcode- See Also:
- Constant Field Values
-
Tanh
public static final int Tanh
The hyperbolic tangent (TanH) activation type. This activation type implements the following function: \code f(x) = a * tanh(b * x) \endcode- See Also:
- Constant Field Values
-
Absolute
public static final int Absolute
The absolute activation type. This activation type implements the following function: \code f(x) = fabs(x) \endcode- See Also:
- Constant Field Values
-
SoftPlus
public static final int SoftPlus
The parametric soft plus activation type. This activation type implements the following function: \code f(x) = a * log(1 + e^(b * x)) \endcode- See Also:
- Constant Field Values
-
SoftSign
public static final int SoftSign
The parametric soft sign activation type. This activation type implements the following function: \code f(x) = x / (1 + abs(x)) \endcod- See Also:
- Constant Field Values
-
ELU
public static final int ELU
The parametric ELU activation type. This activation type implements the following function: \code f(x) = x >= 0 ? x : a * (exp(x) - 1) \endcode- See Also:
- Constant Field Values
-
ReLUN
public static final int ReLUN
The ReLUN activation type. This activation type implements the following function: \code f(x) = min((x >= 0 ? x : a * x), b) \endcode- See Also:
- Constant Field Values
-
LogSigmoid
public static final int LogSigmoid
The log sigmoid activation type. This activation type implements the following function: \code f(x) = log(1 / (1 + exp(-x))) \endcode- See Also:
- Constant Field Values
-
SELU
public static final int SELU
The SELU activation type. This activation type implements the following function: \code f(x) = scale * (max(0, x) + min(0, α * (exp(x) − 1))) \endcode where: \code α = 1.6732632423543772848170429916717 scale = 1.0507009873554804934193349852946 \endcode- See Also:
- Constant Field Values
-
CELU
public static final int CELU
The CELU activation type. This activation type implements the following function: \code f(x) = max(0, x) + min(0, a * (exp(x / a) − 1)) \endcode- See Also:
- Constant Field Values
-
HardShrink
public static final int HardShrink
The hard shrink activation type. This activation type implements the following function: \code f(x) = x, if x > a or x < −a, else 0 \endcode- See Also:
- Constant Field Values
-
SoftShrink
public static final int SoftShrink
The soft shrink activation type. This activation type implements the following function: \code f(x) = x - a, if x > a, x + a, if x < −a, else 0 \endcode- See Also:
- Constant Field Values
-
TanhShrink
public static final int TanhShrink
The hyperbolic tangent (TanH) shrink activation type. This activation type implements the following function: \code f(x) = x - tanh(x) \endcode- See Also:
- Constant Field Values
-
Threshold
public static final int Threshold
The threshold activation type. This activation type implements the following function: \code f(x) = x, if x > a, else b \endcode- See Also:
- Constant Field Values
-
GELU
public static final int GELU
The GELU activation type. This activation type implements the following function: \code f(x) = x * CDF(x) \endcode- See Also:
- Constant Field Values
-
HardSwish
public static final int HardSwish
The hardswish activation type. This activation type implements the following function: \code f(x) = 0, if x <= -3 f(x) = x, if x >= +3 f(x) = x * (x + 3)/6, otherwise \endcode API-Since: 14.5- See Also:
- Constant Field Values
-
Clamp
public static final int Clamp
The clamp activation type. This activation type implements the following function: \code f(x) = min(max(x, a), b) \endcode API-Since: 14.5- See Also:
- Constant Field Values
-
Count
public static final int Count
Must be last- See Also:
- Constant Field Values
-
-