LossFunctionLinear

Trait LossFunctionLinear 

Source
pub trait LossFunctionLinear<'a, U, I, D, const N: usize>:
    LossFunction<U>
    + Send
    + Sync
    + 'static
where U: Clone + Copy + UnitValue<U>, D: Device<U>,
{ type Output; // Required method fn linear_derive<'b>( &self, device: &D, actual: &'b I, expected: &'b I, ) -> Result<Self::Output, TrainingError>; }
Expand description

A property that defines the implementation of the loss function used in the linear layer when training a neural network.

Required Associated Types§

Required Methods§

Source

fn linear_derive<'b>( &self, device: &D, actual: &'b I, expected: &'b I, ) -> Result<Self::Output, TrainingError>

Differentiation of loss functions

§Arguments
  • actual - actual value
  • expected - expected value

Implementors§

Source§

impl<'a, T, U, I, const N: usize> LossFunctionLinear<'a, U, I, DeviceCpu<U>, N> for T
where T: LossFunction<U>, U: UnitValue<U>, for<'b> ArrView<'b, U, N>: From<&'b I>,

Source§

type Output = Arr<U, N>

Source§

impl<'a, U, I, const N: usize> LossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for CrossEntropy<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, for<'b> CudaTensor1dPtrView<'b, U, N>: From<&'b I>, for<'b> LinearCrossEntropy<'b, U, N>: Kernel<Args = LinearCrossEntropyArgs<'b, U, N>>,

Source§

impl<'a, U, I, const N: usize> LossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for CrossEntropyMulticlass<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, for<'b> CudaTensor1dPtrView<'b, U, N>: From<&'b I>, for<'b> LinearCrossEntropyMulticlass<'b, U, N>: Kernel<Args = LinearCrossEntropyMulticlassArgs<'b, U, N>>,

Source§

impl<'a, U, I, const N: usize> LossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for Mse<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, for<'b> CudaTensor1dPtrView<'b, U, N>: From<&'b I>, for<'b> LinearMse<'b, U, N>: Kernel<Args = LinearMseArgs<'b, U, N>>,