pub struct CurriculumLearningTrainer<M: Model> {
pub model: M,
pub config: CurriculumConfig,
pub examples: Vec<CurriculumExample>,
pub current_threshold: f32,
pub current_epoch: usize,
pub step_counter: usize,
pub performance_history: Vec<f32>,
pub difficulty_scorer: Option<DifficultyScorer>,
}Expand description
Curriculum learning trainer
Fields§
§model: MThe model being trained
config: CurriculumConfigConfiguration
examples: Vec<CurriculumExample>All training examples with difficulty scores
current_threshold: f32Current difficulty threshold
current_epoch: usizeCurrent epoch
step_counter: usizeTraining step counter
performance_history: Vec<f32>Performance history for adaptive curriculum
difficulty_scorer: Option<DifficultyScorer>Difficulty scorer for dynamic difficulty estimation
Implementations§
Source§impl<M: Model<Input = Tensor, Output = Tensor>> CurriculumLearningTrainer<M>
impl<M: Model<Input = Tensor, Output = Tensor>> CurriculumLearningTrainer<M>
Sourcepub fn new(model: M, config: CurriculumConfig) -> Result<Self>
pub fn new(model: M, config: CurriculumConfig) -> Result<Self>
Create a new curriculum learning trainer
Sourcepub fn add_examples(&mut self, examples: Vec<CurriculumExample>)
pub fn add_examples(&mut self, examples: Vec<CurriculumExample>)
Add training examples to the curriculum
Sourcepub fn add_example(&mut self, example: CurriculumExample)
pub fn add_example(&mut self, example: CurriculumExample)
Add a single example
Sourcepub fn estimate_difficulties(&mut self) -> Result<()>
pub fn estimate_difficulties(&mut self) -> Result<()>
Estimate difficulty for examples without scores
Sourcepub fn get_current_curriculum(&self) -> Vec<CurriculumExample>
pub fn get_current_curriculum(&self) -> Vec<CurriculumExample>
Get current curriculum subset
Sourcepub fn update_curriculum_threshold(&mut self) -> Result<()>
pub fn update_curriculum_threshold(&mut self) -> Result<()>
Update curriculum threshold based on strategy
Sourcepub fn train_step(&mut self) -> Result<CurriculumLearningOutput>
pub fn train_step(&mut self) -> Result<CurriculumLearningOutput>
Train one step with curriculum
Sourcepub fn train_epoch(&mut self) -> Result<CurriculumEpochOutput>
pub fn train_epoch(&mut self) -> Result<CurriculumEpochOutput>
Train for one epoch with curriculum
Sourcepub fn get_curriculum_stats(&self) -> CurriculumStats
pub fn get_curriculum_stats(&self) -> CurriculumStats
Get curriculum statistics
Auto Trait Implementations§
impl<M> Freeze for CurriculumLearningTrainer<M>where
M: Freeze,
impl<M> RefUnwindSafe for CurriculumLearningTrainer<M>where
M: RefUnwindSafe,
impl<M> Send for CurriculumLearningTrainer<M>
impl<M> Sync for CurriculumLearningTrainer<M>
impl<M> Unpin for CurriculumLearningTrainer<M>where
M: Unpin,
impl<M> UnsafeUnpin for CurriculumLearningTrainer<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for CurriculumLearningTrainer<M>where
M: 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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