pub struct QuadraticTask {
pub dimension: usize,
pub condition_number: f32,
pub name: String,
}Expand description
Simple quadratic task for testing neural optimizers
Fields§
§dimension: usize§condition_number: f32§name: StringImplementations§
Trait Implementations§
Source§impl OptimizationTask for QuadraticTask
impl OptimizationTask for QuadraticTask
Source§fn initialize_parameters(
&self,
device: &CpuDevice,
) -> OptimizerResult<Vec<Tensor>>
fn initialize_parameters( &self, device: &CpuDevice, ) -> OptimizerResult<Vec<Tensor>>
Initialize parameters for this task
Source§fn compute_loss_and_gradients(
&self,
parameters: &[Tensor],
) -> OptimizerResult<(f32, Vec<Tensor>)>
fn compute_loss_and_gradients( &self, parameters: &[Tensor], ) -> OptimizerResult<(f32, Vec<Tensor>)>
Compute loss and gradients for given parameters
Auto Trait Implementations§
impl Freeze for QuadraticTask
impl RefUnwindSafe for QuadraticTask
impl Send for QuadraticTask
impl Sync for QuadraticTask
impl Unpin for QuadraticTask
impl UnsafeUnpin for QuadraticTask
impl UnwindSafe for QuadraticTask
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more