pub enum OptimError {
Show 23 variants
InvalidLearningRate {
lr: f32,
},
InvalidMomentum {
momentum: f32,
},
InvalidBeta1 {
beta1: f32,
},
InvalidBeta2 {
beta2: f32,
},
InvalidEpsilon {
epsilon: f32,
},
InvalidRmsPropAlpha {
alpha: f32,
},
InvalidStepGamma {
gamma: f32,
},
InvalidStepSize {
step_size: usize,
},
InvalidCosineTMax {
t_max: usize,
},
InvalidWarmupSteps {
warmup_steps: usize,
},
InvalidOneCycleTotalSteps {
total_steps: usize,
},
InvalidOneCyclePctStart {
pct_start: f32,
},
InvalidOneCycleFinalDivFactor {
final_div_factor: f32,
},
SchedulerStartLrExceedsBase {
start_lr: f32,
base_lr: f32,
},
SchedulerMaxLrBelowInitial {
max_lr: f32,
initial_lr: f32,
},
SchedulerMinLrExceedsBase {
min_lr: f32,
base_lr: f32,
},
InvalidDampening {
dampening: f32,
},
InvalidWeightDecay {
weight_decay: f32,
},
NesterovRequiresMomentum,
ShapeMismatch {
weights: Vec<usize>,
grad: Vec<usize>,
},
MissingGradient {
node: usize,
},
Tensor(TensorError),
Autograd(AutogradError),
}Expand description
Errors returned by optimizer configuration and update steps.
Variants§
InvalidLearningRate
InvalidMomentum
InvalidBeta1
InvalidBeta2
InvalidEpsilon
InvalidRmsPropAlpha
InvalidStepGamma
InvalidStepSize
InvalidCosineTMax
InvalidWarmupSteps
InvalidOneCycleTotalSteps
InvalidOneCyclePctStart
InvalidOneCycleFinalDivFactor
SchedulerStartLrExceedsBase
SchedulerMaxLrBelowInitial
SchedulerMinLrExceedsBase
InvalidDampening
InvalidWeightDecay
NesterovRequiresMomentum
ShapeMismatch
MissingGradient
Tensor(TensorError)
Autograd(AutogradError)
Trait Implementations§
Source§impl Clone for OptimError
impl Clone for OptimError
Source§fn clone(&self) -> OptimError
fn clone(&self) -> OptimError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptimError
impl Debug for OptimError
Source§impl Display for OptimError
impl Display for OptimError
Source§impl Error for OptimError
impl Error for OptimError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AutogradError> for OptimError
impl From<AutogradError> for OptimError
Source§fn from(source: AutogradError) -> Self
fn from(source: AutogradError) -> Self
Converts to this type from the input type.
Source§impl From<TensorError> for OptimError
impl From<TensorError> for OptimError
Source§fn from(source: TensorError) -> Self
fn from(source: TensorError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OptimError
impl PartialEq for OptimError
impl StructuralPartialEq for OptimError
Auto Trait Implementations§
impl Freeze for OptimError
impl RefUnwindSafe for OptimError
impl Send for OptimError
impl Sync for OptimError
impl Unpin for OptimError
impl UnsafeUnpin for OptimError
impl UnwindSafe for OptimError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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