provide a way to access fedbiomed.common.models.Model
of a TrainingPlan
#1049
Labels
done
issue is completed, it meets the DoD and was merged to the next release integration branch
good first issue
nice to pick for a new contributor
Several portions of code need to access the training plan's
Model
class, but this currently requires accessing the training plan's private variable, which is not clean;This exists in
TrainingPlanWorkflow.breakpoint
,Experiment.run_once
, ...As a developer, I want to provide a cleaner way to access the
Model
class.Add a function to
TrainingPlan
with a name complicated and clearly different fromTrainingPlan.model()
to avoid unwanted access by user, egTrainingPlan.get_model_wrapper_class()
Re-implement
Model
class as a subclass (decorator) ofnn.Module
,SGDClassifier
, etc. to avoid duplication of objects and access methodsTorchModel should be a "transparent wrapper" (I think the pattern is often called a decorator). It should retain all of the functionalities of nn.Module, plus some added interface. This would allow researchers to use it transparently as they would use the torch nn.Module, but internally in Fed-BioMed we could also call the added functionality (e.g. get_weights) when needed.
The text was updated successfully, but these errors were encountered: