ICB-DCM / pyPESTO

python Parameter EStimation TOolbox
https://pypesto.readthedocs.io
BSD 3-Clause "New" or "Revised" License
216 stars 47 forks source link

Decouple `AmiciPredictor` from `AmiciObjective` #1291

Open dweindl opened 7 months ago

dweindl commented 7 months ago

Currently, pypesto.predict.amici_predictor.AmiciPredictor.__init__ requires a pypesto.objective.amici.amici.AmiciObjective. Constructing an AmiciPredictor from an AmiciObjective is admittedly convenient. However, requiring an AmiciObjective renders it unnecessarily complicated to make ensemble predictions for anything other than the original parameter estimation problem (e.g., prediction for unseen experimental conditions).

The only things that AmiciPredictor should require, are an amici model, a (potentially optional) list of amici.ExpData, an amici.Solver, and a parameter mapping. Therefore, I'd suggest to refactor AmiciPredictor to be constructable from only those inputs, while preserving the possibility to construct it from an AmiciObjective.

EDIT: Not so easy to decouple in the case of hierarchical optimization, since the inner parameters aren't included in the ensemble. However, it's questionable if the current state, i.e. recomputing the inner parameters is desirable. I'd say that mostly ones wants the optimal inner parameters computed from the training data and not from any unseen data.

PaulJonasJost commented 6 months ago

so we could add a convenience static function from AmiciObjective? 🤔