Trait BatchLossFunctionLinear

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

Trait defining the implementation of a linear layer loss function with batch processing

Required Associated Types§

Required Methods§

Source

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

Differentiation of loss functions

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

Implementors§

Source§

impl<'a, T, U, I, const N: usize> BatchLossFunctionLinear<'a, U, I, DeviceCpu<U>, N> for T
where T: LossFunction<U>, U: UnitValue<U>, I: BatchSize, for<'b> SerializedVecView<'b, U, Arr<U, N>>: TryFrom<&'b I, Error = TypeConvertError>,

Source§

impl<'a, U, I, const N: usize> BatchLossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for CrossEntropy<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, for<'b> CudaVecView<'b, U, CudaTensor1dPtr<U, N>>: TryFrom<&'b I, Error = TypeConvertError>, for<'b> LinearBatchCrossEntropy<'b, U, N>: Kernel<Args = LinearBatchCrossEntropyArgs<'b, U, N>>,

Source§

impl<'a, U, I, const N: usize> BatchLossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for CrossEntropyMulticlass<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, CudaPtr<U>: TryFrom<U, Error = CudaError>, for<'b> CudaVecView<'b, U, CudaTensor1dPtr<U, N>>: TryFrom<&'b I, Error = TypeConvertError>, for<'b> LinearBatchCrossEntropyMulticlass<'b, U, N>: Kernel<Args = LinearBatchCrossEntropyMulticlassArgs<'b, U, N>>,

Source§

impl<'a, U, I, const N: usize> BatchLossFunctionLinear<'a, U, I, DeviceGpu<U>, N> for Mse<U>
where U: Clone + Copy + UnitValue<U> + DataTypeInfo, DeviceGpu<U>: Device<U>, for<'b> CudaVecView<'b, U, CudaTensor1dPtr<U, N>>: TryFrom<&'b I, Error = TypeConvertError>, for<'b> LinearBatchMse<'b, U, N>: Kernel<Args = LinearBatchMseArgs<'b, U, N>>,