BayesFlow
BayesFlow copied to clipboard
Use Training Strategy Pattern in Trainer
The current implementation of bayesflow.trainers.Trainer implements several training strategies in one large class. This can be problematic for both maintainers and users, since
- Implementing a new strategy from outside
bayesflowrequires inheriting from theTrainerclass - Modifying small parts of a strategy outside of its input parameters can be difficult or impossible
- Maintaining a mental overview over the Trainer functionality is impeded.
We can remedy these issues by implementing the trainer strategies explicitly as their own concept, and following composition over inheritance in the Trainer class.
That's a very important one! Especially since we want to add some new strategies in the process.
Superceded by the removal of the trainer object