Mse

Struct Mse 

Source
pub struct Mse<U>
where U: Clone + Copy + UnitValue<U>,
{ /* private fields */ }
Expand description

Mse implementation

Implementations§

Source§

impl<U> Mse<U>
where U: UnitValue<U>,

Source

pub fn new() -> Mse<U>

Create a Mse instance

Trait Implementations§

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>>,

Source§

type Output = CudaVec<U, CudaTensor1dPtr<U, N>>

Source§

fn batch_linear_derive<'b>( &self, device: &DeviceGpu<U>, expected: &'b I, actual: &'b I, ) -> Result<CudaVec<U, CudaTensor1dPtr<U, N>>, TrainingError>

Differentiation of loss functions Read more
Source§

impl<U> LossFunction<U> for Mse<U>
where U: Clone + Copy + UnitValue<U>,

Source§

fn derive(&self, r: U, t: U) -> U

Differentiation of loss functions Read more
Source§

fn apply(&self, r: U, t: U) -> U

Applying the loss function Read more
Source§

fn name(&self) -> &'static str

this loss function name
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>>,

Source§

type Output = CudaTensor1dPtr<U, N>

Source§

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

Differentiation of loss functions Read more

Auto Trait Implementations§

§

impl<U> Freeze for Mse<U>

§

impl<U> RefUnwindSafe for Mse<U>
where U: RefUnwindSafe,

§

impl<U> Send for Mse<U>

§

impl<U> Sync for Mse<U>

§

impl<U> Unpin for Mse<U>
where U: Unpin,

§

impl<U> UnwindSafe for Mse<U>
where U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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, SerializedVecView<'b, U, Arr<U, N>>: for<'b> TryFrom<&'b I, Error = TypeConvertError>,

Source§

type Output = SerializedVec<U, Arr<U, N>>

Source§

fn batch_linear_derive<'b>( &self, _: &DeviceCpu<U>, expected: &'b I, actual: &'b I, ) -> Result<SerializedVec<U, Arr<U, N>>, TrainingError>

Differentiation of loss functions Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
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>, ArrView<'b, U, N>: for<'b> From<&'b I>,

Source§

type Output = Arr<U, N>

Source§

fn linear_derive<'b>( &self, _: &DeviceCpu<U>, actual: &'b I, expected: &'b I, ) -> Result<Arr<U, N>, TrainingError>

Differentiation of loss functions Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.