do we need a property for trainer called decoratee (without ""_"") when self.model is always equal to decoratee?
smilesun opened this issue · comments
as in the comment of abstract trainer stated, self.decorates can be both model or trainer but self._decoratee can only be trainer, self.get_model() can only be model
after the change below, now self.model can be both trainer and model
Name | |
---|---|
Latest commitsmilesun2 minutes agoHistoryMerge pull request #823 from marrlab/trainer_as_model4970eb6treat trainer as model |
Name
Latest commit
smilesun
smilesun
2 minutes ago
History
Merge pull request #823 from marrlab/trainer_as_model
treat trainer as model
I don't think we need it. Decoratee acts as an abstraction to check if _decoratee is none, and if so accesses the model instead:
@property
def decoratee(self):
if self._decoratee is None:
return self.model
return self._decoratee
However, we are already assigning _decoratee to model in the constructor and could therefore also directly call self.model instead:
I don't think this is particularly intuitive because model can then also be a trainer. We could leave the decoratee but rename _decoratee to trainer. That way decoratee could make the distinction between model and trainer and we only access decoratee.