pub struct GradientCheckConfig<T: Float> {
pub epsilon: T,
pub relative_tolerance: T,
pub absolute_tolerance: T,
pub use_centered_differences: bool,
pub max_params_to_check: Option<usize>,
pub random_seed: Option<u64>,
}Expand description
Numerical gradient checking utilities for neural networks
This module provides tools for validating analytical gradients by comparing them with numerically computed gradients using finite differences. Gradient checking configuration
Fields§
§epsilon: TFinite difference step size (epsilon)
relative_tolerance: TRelative tolerance for gradient comparison
absolute_tolerance: TAbsolute tolerance for gradient comparison
use_centered_differences: boolWhether to use centered differences (more accurate but 2x slower)
max_params_to_check: Option<usize>Maximum number of parameters to check (for efficiency)
random_seed: Option<u64>Random seed for parameter sampling
Trait Implementations§
Source§impl<T: Clone + Float> Clone for GradientCheckConfig<T>
impl<T: Clone + Float> Clone for GradientCheckConfig<T>
Source§fn clone(&self) -> GradientCheckConfig<T>
fn clone(&self) -> GradientCheckConfig<T>
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<T> Freeze for GradientCheckConfig<T>where
T: Freeze,
impl<T> RefUnwindSafe for GradientCheckConfig<T>where
T: RefUnwindSafe,
impl<T> Send for GradientCheckConfig<T>where
T: Send,
impl<T> Sync for GradientCheckConfig<T>where
T: Sync,
impl<T> Unpin for GradientCheckConfig<T>where
T: Unpin,
impl<T> UnwindSafe for GradientCheckConfig<T>where
T: UnwindSafe,
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