pub struct GradientCheckConfig {
pub epsilon: f64,
pub rtol: f64,
pub atol: f64,
pub check_elementwise: bool,
pub use_central_difference: bool,
pub max_samples: Option<usize>,
pub random_seed: Option<u64>,
}Expand description
Configuration for numerical gradient checking
Fields§
§epsilon: f64Epsilon for finite difference computation
rtol: f64Relative tolerance for gradient comparison
atol: f64Absolute tolerance for gradient comparison
check_elementwise: boolCheck gradients element-wise (slower but more detailed)
use_central_difference: boolUse central differences (more accurate but 2x slower)
max_samples: Option<usize>Maximum number of samples to check (for large tensors)
random_seed: Option<u64>Random seed for sampling (if max_samples is set)
Implementations§
Trait Implementations§
Source§impl Clone for GradientCheckConfig
impl Clone for GradientCheckConfig
Source§impl Debug for GradientCheckConfig
impl Debug for GradientCheckConfig
Auto Trait Implementations§
impl Freeze for GradientCheckConfig
impl RefUnwindSafe for GradientCheckConfig
impl Send for GradientCheckConfig
impl Sync for GradientCheckConfig
impl Unpin for GradientCheckConfig
impl UnsafeUnpin for GradientCheckConfig
impl UnwindSafe for GradientCheckConfig
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> 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