Skip to main content

SupervisedLearningStrategy

Trait SupervisedLearningStrategy 

Source
pub trait SupervisedLearningStrategy<M: LearnerModel> {
    // Required method
    fn fit(
        &self,
        training_components: TrainingComponents<M>,
        learner: Learner<M>,
        dataloader_train: TrainLoader<M>,
        dataloader_valid: ValidLoader<M>,
        starting_epoch: usize,
    ) -> (M, SupervisedTrainingEventProcessor<M>);

    // Provided method
    fn train(
        &self,
        learner: Learner<M>,
        dataloader_train: TrainLoader<M>,
        dataloader_valid: ValidLoader<M>,
        training_components: TrainingComponents<M>,
    ) -> LearningResult<M> { ... }
}
Expand description

Provides the fit function for any learning strategy

Required Methods§

Source

fn fit( &self, training_components: TrainingComponents<M>, learner: Learner<M>, dataloader_train: TrainLoader<M>, dataloader_valid: ValidLoader<M>, starting_epoch: usize, ) -> (M, SupervisedTrainingEventProcessor<M>)

Training loop for this strategy

Provided Methods§

Source

fn train( &self, learner: Learner<M>, dataloader_train: TrainLoader<M>, dataloader_valid: ValidLoader<M>, training_components: TrainingComponents<M>, ) -> LearningResult<M>

Train the learner’s model with this strategy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§