BayesFlow icon indicating copy to clipboard operation
BayesFlow copied to clipboard

Use Training Strategy Pattern in Trainer

Open LarsKue opened this issue 1 year ago • 1 comments

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

  1. Implementing a new strategy from outside bayesflow requires inheriting from the Trainer class
  2. Modifying small parts of a strategy outside of its input parameters can be difficult or impossible
  3. 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.

LarsKue avatar Feb 16 '24 16:02 LarsKue

That's a very important one! Especially since we want to add some new strategies in the process.

stefanradev93 avatar Feb 16 '24 16:02 stefanradev93

Superceded by the removal of the trainer object

LarsKue avatar Jul 09 '24 14:07 LarsKue