pub struct Softplus<D: Float, T, const RANK: usize> {
pub beta: f64,
pub threshold: f64,
/* private fields */
}Expand description
Softplus activation layer: a smooth ReLU approximation, (1/beta) * ln(1 + e^(beta*x)),
reverting to linear above threshold for numerical stability.
Fields§
§beta: f64The beta sharpness parameter.
threshold: f64Above this value, the layer reverts to linear (x) to avoid overflow in exp.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<D, T, const RANK: usize> Freeze for Softplus<D, T, RANK>
impl<D, T, const RANK: usize> RefUnwindSafe for Softplus<D, T, RANK>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<D, T, const RANK: usize> Send for Softplus<D, T, RANK>
impl<D, T, const RANK: usize> Sync for Softplus<D, T, RANK>
impl<D, T, const RANK: usize> Unpin for Softplus<D, T, RANK>
impl<D, T, const RANK: usize> UnsafeUnpin for Softplus<D, T, RANK>
impl<D, T, const RANK: usize> UnwindSafe for Softplus<D, T, RANK>where
D: UnwindSafe,
T: UnwindSafe,
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