pub struct CurriculumManager<A: Float, D: Dimension> { /* private fields */ }Expand description
Curriculum learning manager
Implementations§
Source§impl<A: Float + ScalarOperand + Debug, D: Dimension + Send + Sync> CurriculumManager<A, D>
impl<A: Float + ScalarOperand + Debug, D: Dimension + Send + Sync> CurriculumManager<A, D>
Sourcepub fn new(
strategy: CurriculumStrategy,
importance_strategy: ImportanceWeightingStrategy,
) -> Self
pub fn new( strategy: CurriculumStrategy, importance_strategy: ImportanceWeightingStrategy, ) -> Self
Create a new curriculum manager
Sourcepub fn enable_adversarial_training(&mut self, config: AdversarialConfig<A>)
pub fn enable_adversarial_training(&mut self, config: AdversarialConfig<A>)
Enable adversarial training
Sourcepub fn disable_adversarial_training(&mut self)
pub fn disable_adversarial_training(&mut self)
Disable adversarial training
Sourcepub fn update_curriculum(&mut self, performance: A) -> Result<()>
pub fn update_curriculum(&mut self, performance: A) -> Result<()>
Update curriculum based on performance
Sourcepub fn set_sample_difficulty(&mut self, sampleid: usize, difficulty: f64)
pub fn set_sample_difficulty(&mut self, sampleid: usize, difficulty: f64)
Set difficulty score for a sample
Sourcepub fn should_include_sample(&self, sampleid: usize) -> bool
pub fn should_include_sample(&self, sampleid: usize) -> bool
Check if sample should be included based on current difficulty
Sourcepub fn get_current_difficulty(&self) -> f64
pub fn get_current_difficulty(&self) -> f64
Get current difficulty level
Sourcepub fn compute_sample_weights(
&mut self,
sampleids: &[usize],
losses: &[A],
gradient_norms: Option<&[A]>,
uncertainties: Option<&[A]>,
) -> Result<()>
pub fn compute_sample_weights( &mut self, sampleids: &[usize], losses: &[A], gradient_norms: Option<&[A]>, uncertainties: Option<&[A]>, ) -> Result<()>
Compute importance weights for samples
Sourcepub fn get_sample_weight(&self, sampleid: usize) -> A
pub fn get_sample_weight(&self, sampleid: usize) -> A
Get importance weight for a sample
Sourcepub fn generate_adversarial_examples(
&self,
inputs: &Array<A, D>,
gradients: &Array<A, D>,
) -> Result<Array<A, D>>
pub fn generate_adversarial_examples( &self, inputs: &Array<A, D>, gradients: &Array<A, D>, ) -> Result<Array<A, D>>
Generate adversarial examples
Sourcepub fn filter_samples(&self, sampleids: &[usize]) -> Vec<usize>
pub fn filter_samples(&self, sampleids: &[usize]) -> Vec<usize>
Get filtered samples based on current curriculum
Sourcepub fn get_performance_history(&self) -> &VecDeque<A>
pub fn get_performance_history(&self) -> &VecDeque<A>
Get performance history
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Get step count
Sourcepub fn export_state(&self) -> CurriculumState<A>
pub fn export_state(&self) -> CurriculumState<A>
Export curriculum state for analysis
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for CurriculumManager<A, D>where
A: Freeze,
impl<A, D> RefUnwindSafe for CurriculumManager<A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, D> Send for CurriculumManager<A, D>where
A: Send,
impl<A, D> Sync for CurriculumManager<A, D>where
A: Sync,
impl<A, D> Unpin for CurriculumManager<A, D>
impl<A, D> UnwindSafe for CurriculumManager<A, D>where
A: UnwindSafe,
D: 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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.