pub struct RobustnessManager { /* private fields */ }Expand description
Robustness manager for optimizers
Implementations§
Source§impl RobustnessManager
impl RobustnessManager
pub fn new(config: RobustnessConfig) -> Self
Sourcepub fn process_gradients(
&mut self,
gradients: &HashMap<String, Tensor>,
) -> OptimizerResult<HashMap<String, Tensor>>
pub fn process_gradients( &mut self, gradients: &HashMap<String, Tensor>, ) -> OptimizerResult<HashMap<String, Tensor>>
Apply robustness transformations to gradients
Sourcepub fn generate_adversarial_perturbation(
&self,
input: &Tensor,
gradient: &Tensor,
) -> OptimizerResult<Tensor>
pub fn generate_adversarial_perturbation( &self, input: &Tensor, gradient: &Tensor, ) -> OptimizerResult<Tensor>
Generate adversarial perturbations for robust training
Sourcepub fn get_stats(&self) -> &RobustnessStats
pub fn get_stats(&self) -> &RobustnessStats
Get current robustness statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Sourcepub fn is_training_stable(&self) -> bool
pub fn is_training_stable(&self) -> bool
Check if training appears stable
Sourcepub fn get_recommendations(&self) -> Vec<String>
pub fn get_recommendations(&self) -> Vec<String>
Get recommendations for improving robustness
Auto Trait Implementations§
impl Freeze for RobustnessManager
impl RefUnwindSafe for RobustnessManager
impl Send for RobustnessManager
impl Sync for RobustnessManager
impl Unpin for RobustnessManager
impl UnsafeUnpin for RobustnessManager
impl UnwindSafe for RobustnessManager
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