pub struct Sigmoid {}
Expand description
Computes the sigmoid function, aka. the standard logistic function, 1. / (1. + (-x).exp())
.
This has a maximum error of 4 ULPs compared to a reference implementation
using 1. / (1. + (-x).exp())
.
Trait Implementations§
Source§impl SimdUnaryOp<f32> for Sigmoid
impl SimdUnaryOp<f32> for Sigmoid
Source§fn eval<I: Isa, S: Simd<Elem = f32, Isa = I>>(&self, isa: I, x: S) -> S
fn eval<I: Isa, S: Simd<Elem = f32, Isa = I>>(&self, isa: I, x: S) -> S
Evaluate the unary function on the elements in
x
. Read moreSource§fn map(&self, input: &[T], output: &mut [MaybeUninit<T>])
fn map(&self, input: &[T], output: &mut [MaybeUninit<T>])
Apply this function to a slice. Read more
Source§fn map_mut(&self, input: &mut [T])
fn map_mut(&self, input: &mut [T])
Apply a vectorized unary function to a mutable slice. Read more
Source§fn scalar_eval(&self, x: T) -> T
fn scalar_eval(&self, x: T) -> T
Apply this operation to a single element.
Auto Trait Implementations§
impl Freeze for Sigmoid
impl RefUnwindSafe for Sigmoid
impl Send for Sigmoid
impl Sync for Sigmoid
impl Unpin for Sigmoid
impl UnwindSafe for Sigmoid
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