#[repr(transparent)]pub struct MLCActivationType(pub i32);
MLCTypes
only.Expand description
An activation type that you specify for an activation descriptor.
See also Apple’s documentation
Tuple Fields§
§0: i32
Implementations§
Source§impl MLCActivationType
impl MLCActivationType
Sourcepub const ReLU: Self
pub const ReLU: Self
The ReLU activation type.
This activation type implements the following function:
f(x) = x >= 0 ? x : a * x
Sourcepub const Linear: Self
pub const Linear: Self
The linear activation type.
This activation type implements the following function:
f(x) = a * x + b
Sourcepub const Sigmoid: Self
pub const Sigmoid: Self
The sigmoid activation type.
This activation type implements the following function:
f(x) = 1 / (1 + e⁻ˣ)
Sourcepub const HardSigmoid: Self
pub const HardSigmoid: Self
The hard sigmoid activation type.
This activation type implements the following function:
f(x) = clamp((x * a) + b, 0, 1)
Sourcepub const Tanh: Self
pub const Tanh: Self
The hyperbolic tangent (TanH) activation type.
This activation type implements the following function:
f(x) = a * tanh(b * x)
Sourcepub const Absolute: Self
pub const Absolute: Self
The absolute activation type.
This activation type implements the following function:
f(x) = fabs(x)
Sourcepub const SoftPlus: Self
pub const SoftPlus: Self
The parametric soft plus activation type.
This activation type implements the following function:
f(x) = a * log(1 + e^(b * x))
Sourcepub const SoftSign: Self
pub const SoftSign: Self
The parametric soft sign activation type.
This activation type implements the following function:
f(x) = x / (1 + abs(x))
\endcod
Sourcepub const ELU: Self
pub const ELU: Self
The parametric ELU activation type.
This activation type implements the following function:
f(x) = x >= 0 ? x : a * (exp(x) - 1)
Sourcepub const ReLUN: Self
pub const ReLUN: Self
The ReLUN activation type.
This activation type implements the following function:
f(x) = min((x >= 0 ? x : a * x), b)
Sourcepub const LogSigmoid: Self
pub const LogSigmoid: Self
The log sigmoid activation type.
This activation type implements the following function:
f(x) = log(1 / (1 + exp(-x)))
Sourcepub const SELU: Self
pub const SELU: Self
The SELU activation type.
This activation type implements the following function:
f(x) = scale * (max(0, x) + min(0, α * (exp(x) − 1)))
where:
α = 1.6732632423543772848170429916717
scale = 1.0507009873554804934193349852946
Sourcepub const CELU: Self
pub const CELU: Self
The CELU activation type.
This activation type implements the following function:
f(x) = max(0, x) + min(0, a * (exp(x / a) − 1))
Sourcepub const HardShrink: Self
pub const HardShrink: Self
The hard shrink activation type.
This activation type implements the following function:
f(x) = x, if x > a or x < −a, else 0
Sourcepub const SoftShrink: Self
pub const SoftShrink: Self
The soft shrink activation type.
This activation type implements the following function:
f(x) = x - a, if x > a, x + a, if x < −a, else 0
Sourcepub const TanhShrink: Self
pub const TanhShrink: Self
The hyperbolic tangent (TanH) shrink activation type.
This activation type implements the following function:
f(x) = x - tanh(x)
Sourcepub const Threshold: Self
pub const Threshold: Self
The threshold activation type.
This activation type implements the following function:
f(x) = x, if x > a, else b
Sourcepub const GELU: Self
pub const GELU: Self
The GELU activation type.
This activation type implements the following function:
f(x) = x * CDF(x)
Sourcepub const HardSwish: Self
pub const HardSwish: Self
The hardswish activation type.
This activation type implements the following function:
f(x) = 0, if x <= -3
f(x) = x, if x >= +3
f(x) = x * (x + 3)/6, otherwise
Source§impl MLCActivationType
impl MLCActivationType
Sourcepub unsafe fn debug_description(self: MLCActivationType) -> Retained<NSString>
pub unsafe fn debug_description(self: MLCActivationType) -> Retained<NSString>
Returns a textual description of the activation type, suitable for debugging.
Trait Implementations§
Source§impl Clone for MLCActivationType
impl Clone for MLCActivationType
Source§fn clone(&self) -> MLCActivationType
fn clone(&self) -> MLCActivationType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more