pub enum Activation {
Relu,
Gelu,
GeluTanh,
Silu,
Sigmoid,
Tanh,
None,
}Expand description
Activation function types supported by DNN kernels.
These correspond to the most common activation functions used in deep learning. Fused activation (e.g. conv + bias + ReLU) avoids extra memory round-trips and is a key optimisation target.
Variants§
Relu
Rectified Linear Unit: max(0, x).
Gelu
Gaussian Error Linear Unit (exact): x * Phi(x).
GeluTanh
GELU approximated via tanh.
Silu
Sigmoid Linear Unit (SiLU / Swish): x * sigmoid(x).
Sigmoid
Logistic sigmoid: 1 / (1 + exp(-x)).
Tanh
Hyperbolic tangent.
None
Identity (no activation applied).
Trait Implementations§
Source§impl Clone for Activation
impl Clone for Activation
Source§fn clone(&self) -> Activation
fn clone(&self) -> Activation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Activation
Source§impl Debug for Activation
impl Debug for Activation
impl Eq for Activation
Source§impl Hash for Activation
impl Hash for Activation
Source§impl PartialEq for Activation
impl PartialEq for Activation
Source§fn eq(&self, other: &Activation) -> bool
fn eq(&self, other: &Activation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Activation
Auto Trait Implementations§
impl Freeze for Activation
impl RefUnwindSafe for Activation
impl Send for Activation
impl Sync for Activation
impl Unpin for Activation
impl UnsafeUnpin for Activation
impl UnwindSafe for Activation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more