pub struct Softmax(pub f32);
Expand description
A softmax activation layer with no trainable parameters.
Tuple Fields§
§0: f32
Trait Implementations§
Source§impl LoadableModule for Softmax
impl LoadableModule for Softmax
Source§impl ResetParams for Softmax
impl ResetParams for Softmax
Source§impl<E: Float, const I: usize> RevModule<[E; I]> for Softmax
impl<E: Float, const I: usize> RevModule<[E; I]> for Softmax
Source§type SelfGrads = ()
type SelfGrads = ()
The type describing gradients with respect to the modules’ own parameters.
Auto Trait Implementations§
impl Freeze for Softmax
impl RefUnwindSafe for Softmax
impl Send for Softmax
impl Sync for Softmax
impl Unpin for Softmax
impl UnwindSafe for Softmax
Blanket Implementations§
Source§impl<Input, M> BackpropModule<Input> for Mwhere
M: TracedModule<Input, Trace = Input> + RevModule<Input> + BaseModule,
impl<Input, M> BackpropModule<Input> for Mwhere
M: TracedModule<Input, Trace = Input> + RevModule<Input> + BaseModule,
Source§type SelfGrads = <M as RevModule<Input>>::SelfGrads
type SelfGrads = <M as RevModule<Input>>::SelfGrads
Type describing movement in the modules’ own parameters in response to backpropagation.
Source§fn backprop(
&self,
trace: &<M as TracedModule<Input>>::Trace,
grads_wrt_output: <M as Module<Input>>::Output,
) -> (Input, <M as BackpropModule<Input>>::SelfGrads)
fn backprop( &self, trace: &<M as TracedModule<Input>>::Trace, grads_wrt_output: <M as Module<Input>>::Output, ) -> (Input, <M as BackpropModule<Input>>::SelfGrads)
Computes gradients for this layer/module, given tracing state from forward
execution, and the gradients of the output. Read more
Source§fn update(
&mut self,
applyer: &mut impl GradApplyer,
updates: <M as BackpropModule<Input>>::SelfGrads,
) -> Result<(), ()>
fn update( &mut self, applyer: &mut impl GradApplyer, updates: <M as BackpropModule<Input>>::SelfGrads, ) -> Result<(), ()>
Applies a gradient update step, given (Self::SelfGrads) and a
GradApplyer
. Read moreSource§fn new_momentum(
&self,
params: TrainParams,
momentum_coefficient: f32,
) -> Momentum<Self::SelfGrads>
fn new_momentum( &self, params: TrainParams, momentum_coefficient: f32, ) -> Momentum<Self::SelfGrads>
Returns a
GradApplyer
object needed to train using SGD + momentum.Source§fn new_rmsprop(
&self,
params: TrainParams,
beta: f32,
) -> RMSProp<Self::SelfGrads>
fn new_rmsprop( &self, params: TrainParams, beta: f32, ) -> RMSProp<Self::SelfGrads>
Returns a
GradApplyer
object needed to train using rmsprop.Source§fn new_rmsprop_with_momentum(
&self,
params: TrainParams,
momentum_coefficient: f32,
beta: f32,
) -> RMSProp<Self::SelfGrads>
fn new_rmsprop_with_momentum( &self, params: TrainParams, momentum_coefficient: f32, beta: f32, ) -> RMSProp<Self::SelfGrads>
Returns a
GradApplyer
object needed to train using rmsprop + momentum.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Input, M> TracedModule<Input> for Mwhere
M: Module<Input> + BaseModule,
impl<Input, M> TracedModule<Input> for Mwhere
M: Module<Input> + BaseModule,
Source§fn traced_forward(
&self,
x: Input,
) -> Result<(<M as Module<Input>>::Output, <M as TracedModule<Input>>::Trace), ()>
fn traced_forward( &self, x: Input, ) -> Result<(<M as Module<Input>>::Output, <M as TracedModule<Input>>::Trace), ()>
Same as Module::forward, except intermediate computations that are needed
for backprop are returned.