pub struct Activation { /* private fields */ }Expand description
Generic activation layer that wraps an activation type.
Implementations§
Source§impl Activation
impl Activation
Sourcepub fn new(activation_type: ActivationType) -> Self
pub fn new(activation_type: ActivationType) -> Self
Creates a new activation layer.
Sourcepub fn activation_type(&self) -> ActivationType
pub fn activation_type(&self) -> ActivationType
Returns the activation type.
Sourcepub fn apply_inplace(&self, data: &mut [f32])
pub fn apply_inplace(&self, data: &mut [f32])
Applies the activation in-place.
Source§impl Activation
impl Activation
Sourcepub fn hard_swish() -> Self
pub fn hard_swish() -> Self
Creates a HardSwish activation.
Sourcepub fn hard_sigmoid() -> Self
pub fn hard_sigmoid() -> Self
Creates a HardSigmoid activation (using Sigmoid as approximation).
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Activation
impl Debug 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