Struct nncombinator::activation::ReLu
source · [−]Expand description
ReLu Implementation
Implementations
Trait Implementations
sourceimpl<U, const N: usize> Activation<U, Arr<U, N>, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
impl<U, const N: usize> Activation<U, Arr<U, N>, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
sourcefn apply(
&self,
device: &DeviceCpu<U>,
input: &Arr<U, N>
) -> Result<Arr<U, N>, EvaluateError>
fn apply(
&self,
device: &DeviceCpu<U>,
input: &Arr<U, N>
) -> Result<Arr<U, N>, EvaluateError>
Apply the activation function Read more
sourcefn derive(
&self,
device: &DeviceCpu<U>,
o: &Arr<U, N>,
loss: &Arr<U, N>,
u: &Arr<U, N>
) -> Result<Arr<U, N>, TrainingError>
fn derive(
&self,
device: &DeviceCpu<U>,
o: &Arr<U, N>,
loss: &Arr<U, N>,
u: &Arr<U, N>
) -> Result<Arr<U, N>, TrainingError>
Apply derivatives of the activation function Read more
sourcefn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
fn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
Returns whether or not the canonical linkage function can be used. Read more
sourceimpl<U, const N: usize> Activation<U, Arr<U, N>, Arr<U, N>, DeviceGpu<U>> for ReLu<U, DeviceGpu<U>>where
U: UnitValue<U> + DataTypeInfo,
DeviceGpu<U>: Device<U>,
ReLuForward<U>: Kernel<Args = ActivationForwardArgs<U>>,
ReLuBackward<U>: Kernel<Args = ActivationBackwardArgs<U>>,
impl<U, const N: usize> Activation<U, Arr<U, N>, Arr<U, N>, DeviceGpu<U>> for ReLu<U, DeviceGpu<U>>where
U: UnitValue<U> + DataTypeInfo,
DeviceGpu<U>: Device<U>,
ReLuForward<U>: Kernel<Args = ActivationForwardArgs<U>>,
ReLuBackward<U>: Kernel<Args = ActivationBackwardArgs<U>>,
sourcefn apply(
&self,
_: &DeviceGpu<U>,
input: &Arr<U, N>
) -> Result<Arr<U, N>, EvaluateError>
fn apply(
&self,
_: &DeviceGpu<U>,
input: &Arr<U, N>
) -> Result<Arr<U, N>, EvaluateError>
Apply the activation function Read more
sourcefn derive(
&self,
_: &DeviceGpu<U>,
_: &Arr<U, N>,
loss: &Arr<U, N>,
u: &Arr<U, N>
) -> Result<Arr<U, N>, TrainingError>
fn derive(
&self,
_: &DeviceGpu<U>,
_: &Arr<U, N>,
loss: &Arr<U, N>,
u: &Arr<U, N>
) -> Result<Arr<U, N>, TrainingError>
Apply derivatives of the activation function Read more
sourcefn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
fn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
Returns whether or not the canonical linkage function can be used. Read more
sourceimpl<U, I, const N: usize> Activation<U, I, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
I: Iterator<Item = U> + Clone,
impl<U, I, const N: usize> Activation<U, I, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
I: Iterator<Item = U> + Clone,
sourcefn apply(&self, _: &DeviceCpu<U>, input: &I) -> Result<Arr<U, N>, EvaluateError>
fn apply(&self, _: &DeviceCpu<U>, input: &I) -> Result<Arr<U, N>, EvaluateError>
Apply the activation function Read more
sourcefn derive(
&self,
_: &DeviceCpu<U>,
_: &I,
loss: &I,
u: &I
) -> Result<Arr<U, N>, TrainingError>
fn derive(
&self,
_: &DeviceCpu<U>,
_: &I,
loss: &I,
u: &I
) -> Result<Arr<U, N>, TrainingError>
Apply derivatives of the activation function Read more
sourcefn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
fn is_canonical_link<L: LossFunction<U>>(&self, _: &L) -> bool
Returns whether or not the canonical linkage function can be used. Read more
sourceimpl<U, const N: usize> BatchActivation<U, Arr<U, N>, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
Vec<Arr<U, N>>: FromParallelIterator<Arr<U, N>>,
impl<U, const N: usize> BatchActivation<U, Arr<U, N>, Arr<U, N>, DeviceCpu<U>> for ReLu<U, DeviceCpu<U>>where
U: UnitValue<U>,
Vec<Arr<U, N>>: FromParallelIterator<Arr<U, N>>,
sourcefn batch_apply(
&self,
device: &DeviceCpu<U>,
input: &VecArr<U, Arr<U, N>>
) -> Result<VecArr<U, Arr<U, N>>, TrainingError>
fn batch_apply(
&self,
device: &DeviceCpu<U>,
input: &VecArr<U, Arr<U, N>>
) -> Result<VecArr<U, Arr<U, N>>, TrainingError>
Apply the activation function Read more
sourceimpl<U, const N: usize> BatchActivation<U, Arr<U, N>, Arr<U, N>, DeviceGpu<U>> for ReLu<U, DeviceGpu<U>>where
U: UnitValue<U> + DataTypeInfo,
DeviceGpu<U>: Device<U>,
ReLuForward<U>: Kernel<Args = ActivationForwardArgs<U>>,
ReLuBackward<U>: Kernel<Args = ActivationBackwardArgs<U>>,
impl<U, const N: usize> BatchActivation<U, Arr<U, N>, Arr<U, N>, DeviceGpu<U>> for ReLu<U, DeviceGpu<U>>where
U: UnitValue<U> + DataTypeInfo,
DeviceGpu<U>: Device<U>,
ReLuForward<U>: Kernel<Args = ActivationForwardArgs<U>>,
ReLuBackward<U>: Kernel<Args = ActivationBackwardArgs<U>>,
sourcefn batch_apply(
&self,
_: &DeviceGpu<U>,
input: &VecArr<U, Arr<U, N>>
) -> Result<VecArr<U, Arr<U, N>>, TrainingError>
fn batch_apply(
&self,
_: &DeviceGpu<U>,
input: &VecArr<U, Arr<U, N>>
) -> Result<VecArr<U, Arr<U, N>>, TrainingError>
Apply the activation function Read more
Auto Trait Implementations
impl<U, D> RefUnwindSafe for ReLu<U, D>where
D: RefUnwindSafe,
U: RefUnwindSafe,
impl<U, D> Send for ReLu<U, D>where
D: Send,
impl<U, D> Sync for ReLu<U, D>where
D: Sync,
impl<U, D> Unpin for ReLu<U, D>where
D: Unpin,
U: Unpin,
impl<U, D> UnwindSafe for ReLu<U, D>where
D: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more