Skip to main content

SupervisedLearningStrategy

Trait SupervisedLearningStrategy 

pub trait SupervisedLearningStrategy<M>
where M: LearnerModel,
{ // Required method fn fit( &self, training_components: TrainingComponents<M>, learner: Learner<M>, dataloader_train: Arc<dyn DataLoader<<M as TrainStep>::Input>>, dataloader_valid: Arc<dyn DataLoader<<M as InferenceStep>::Input>>, starting_epoch: usize, ) -> (M, AsyncProcessorTraining<LearnerEvent<<M as TrainStep>::Output>, LearnerEvent<<M as InferenceStep>::Output>>); // Provided method fn train( &self, learner: Learner<M>, dataloader_train: Arc<dyn DataLoader<<M as TrainStep>::Input>>, dataloader_valid: Arc<dyn DataLoader<<M as InferenceStep>::Input>>, training_components: TrainingComponents<M>, ) -> LearningResult<M> { ... } }
Expand description

Provides the fit function for any learning strategy

Required Methods§

fn fit( &self, training_components: TrainingComponents<M>, learner: Learner<M>, dataloader_train: Arc<dyn DataLoader<<M as TrainStep>::Input>>, dataloader_valid: Arc<dyn DataLoader<<M as InferenceStep>::Input>>, starting_epoch: usize, ) -> (M, AsyncProcessorTraining<LearnerEvent<<M as TrainStep>::Output>, LearnerEvent<<M as InferenceStep>::Output>>)

Training loop for this strategy

Provided Methods§

fn train( &self, learner: Learner<M>, dataloader_train: Arc<dyn DataLoader<<M as TrainStep>::Input>>, dataloader_valid: Arc<dyn DataLoader<<M as InferenceStep>::Input>>, 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§