pub struct GradientError {
pub param_id: String,
pub index: usize,
pub analytical_grad: f64,
pub numerical_grad: f64,
pub abs_error: f64,
pub rel_error: f64,
}Expand description
Information about a gradient error
Fields§
§param_id: StringParameter identifier
index: usizeIndex in the flattened parameter vector
analytical_grad: f64Analytical gradient from autodiff
numerical_grad: f64Numerical gradient from finite differences
abs_error: f64Absolute error
rel_error: f64Relative error
Implementations§
Source§impl GradientError
impl GradientError
Sourcepub fn new(
param_id: String,
index: usize,
analytical: f64,
numerical: f64,
) -> Self
pub fn new( param_id: String, index: usize, analytical: f64, numerical: f64, ) -> Self
Create a new gradient error
Sourcepub fn exceeds_tolerance(&self, config: &GradCheckConfig) -> bool
pub fn exceeds_tolerance(&self, config: &GradCheckConfig) -> bool
Check if this error exceeds tolerances
Trait Implementations§
Source§impl Clone for GradientError
impl Clone for GradientError
Source§fn clone(&self) -> GradientError
fn clone(&self) -> GradientError
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 moreAuto Trait Implementations§
impl Freeze for GradientError
impl RefUnwindSafe for GradientError
impl Send for GradientError
impl Sync for GradientError
impl Unpin for GradientError
impl UnwindSafe for GradientError
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