#[repr(i32)]pub enum ActivationMode {
KNone = 0,
KSigmoid = 1,
KRelu = 2,
KRelu6 = 3,
KReluX = 4,
KTanh = 5,
KBandPass = 6,
KElu = 7,
KLeakyRelu = 8,
KGeluExact = 9,
}Expand description
Describes a kind of non-linearity (threshold-like mathematical function).
Variants§
KNone = 0
KSigmoid = 1
KRelu = 2
Rectified linear activation: f(x) = x < 0 ? 0 : x
KRelu6 = 3
Rectified linear activation; where upper maximum is 6.0.
KReluX = 4
Rectified linear activation; where upper maximum specified by BatchDescriptor::value_max().
KTanh = 5
KBandPass = 6
Like ReluX; but passes all values in the range [-X,X].
KElu = 7
Exponential linear activation: f(x) = x < 0 ? e^x - 1 : x
KLeakyRelu = 8
Leaky Rectified linear activation: f(x) = x < 0 ? alpha * x : x
KGeluExact = 9
Gaussian Error linear unit activation: x * P(X <= x) = 0.5 * x * (1 + erf(x / sqrt(2))), where P(X) ~ N(0, 1).
Implementations§
Source§impl ActivationMode
impl ActivationMode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for ActivationMode
impl Clone for ActivationMode
Source§fn clone(&self) -> ActivationMode
fn clone(&self) -> ActivationMode
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActivationMode
impl Debug for ActivationMode
Source§impl Default for ActivationMode
impl Default for ActivationMode
Source§fn default() -> ActivationMode
fn default() -> ActivationMode
Source§impl From<ActivationMode> for i32
impl From<ActivationMode> for i32
Source§fn from(value: ActivationMode) -> i32
fn from(value: ActivationMode) -> i32
Source§impl Hash for ActivationMode
impl Hash for ActivationMode
Source§impl Ord for ActivationMode
impl Ord for ActivationMode
Source§impl PartialEq for ActivationMode
impl PartialEq for ActivationMode
Source§impl PartialOrd for ActivationMode
impl PartialOrd for ActivationMode
Source§impl TryFrom<i32> for ActivationMode
impl TryFrom<i32> for ActivationMode
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<ActivationMode, UnknownEnumValue>
fn try_from(value: i32) -> Result<ActivationMode, UnknownEnumValue>
impl Copy for ActivationMode
impl Eq for ActivationMode
impl StructuralPartialEq for ActivationMode
Auto Trait Implementations§
impl Freeze for ActivationMode
impl RefUnwindSafe for ActivationMode
impl Send for ActivationMode
impl Sync for ActivationMode
impl Unpin for ActivationMode
impl UnwindSafe for ActivationMode
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)