pub struct SelfPacedCurriculum { /* private fields */ }Expand description
Self-paced curriculum learning
Reference: [Kumar et al. 2010] “Self-Paced Learning for Latent Variable Models”
- Automatically determines sample difficulty from loss
- Adapts pace based on model performance
Implementations§
Source§impl SelfPacedCurriculum
impl SelfPacedCurriculum
Sourcepub fn new(initial_threshold: f64, growth_rate: f64) -> SelfPacedCurriculum
pub fn new(initial_threshold: f64, growth_rate: f64) -> SelfPacedCurriculum
Create a new self-paced curriculum
§Arguments
initial_threshold- Starting difficulty threshold (e.g., 0.1)growth_rate- How much to increase threshold per advance (e.g., 1.5)
Sourcepub fn with_max_threshold(self, max: f64) -> SelfPacedCurriculum
pub fn with_max_threshold(self, max: f64) -> SelfPacedCurriculum
Set maximum threshold
Sourcepub fn add_samples(&mut self, samples: Vec<ScoredSample>)
pub fn add_samples(&mut self, samples: Vec<ScoredSample>)
Add samples with difficulty scores
Sourcepub fn update_difficulties<F>(&mut self, loss_fn: F)
pub fn update_difficulties<F>(&mut self, loss_fn: F)
Update difficulties based on model predictions
§Arguments
loss_fn- Function that computes loss for a sample
Sourcepub fn next_batch(&mut self, batch_size: usize) -> Vec<&ScoredSample>
pub fn next_batch(&mut self, batch_size: usize) -> Vec<&ScoredSample>
Get next batch of samples below current threshold
Sourcepub fn eligible_samples(&self) -> Vec<&ScoredSample>
pub fn eligible_samples(&self) -> Vec<&ScoredSample>
Get all samples below current threshold
Sourcepub fn n_eligible(&self) -> usize
pub fn n_eligible(&self) -> usize
Get number of eligible samples
Trait Implementations§
Source§impl Clone for SelfPacedCurriculum
impl Clone for SelfPacedCurriculum
Source§fn clone(&self) -> SelfPacedCurriculum
fn clone(&self) -> SelfPacedCurriculum
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CurriculumScheduler for SelfPacedCurriculum
impl CurriculumScheduler for SelfPacedCurriculum
Source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Check if curriculum is complete
Source§fn current_threshold(&self) -> f64
fn current_threshold(&self) -> f64
Get the difficulty threshold for current stage
Auto Trait Implementations§
impl Freeze for SelfPacedCurriculum
impl RefUnwindSafe for SelfPacedCurriculum
impl Send for SelfPacedCurriculum
impl Sync for SelfPacedCurriculum
impl Unpin for SelfPacedCurriculum
impl UnsafeUnpin for SelfPacedCurriculum
impl UnwindSafe for SelfPacedCurriculum
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