We observed there were differences in the optimization between main (0.7) and staging (0.8-dev) and found the problem to be related to models in which parameters relations (expression) were used.
After some debugging we found that the order of execution (evaluating parameters) was incorrect, the parameter that had dependencies would itself be added before its dependencies causing it to be evaluated with values from a previous iteration.
Then observe that the optimization (given sufficient number of iterations) is following a different trajectory.
If no update to the relation parameter happens (e.g. it is fixed, or there are not sufficient iterations/function evaluations possible) you will not see it. Also the first iteration is always idential because the initial parameter values are used.
Important note is that on main the order in which parameters are evlauated is the order in which they were put in the parameters specification file, thus to ensure correctness, relation parameters need to be before the parameters in which they are used in an expresssion.
Expected behavior
Both main and staging follow the same optimization trajectory and arrive at the same final result.
Version information
Describe the bug
We observed there were differences in the optimization between main (0.7) and staging (0.8-dev) and found the problem to be related to models in which parameters relations (expression) were used.
After some debugging we found that the order of execution (evaluating parameters) was incorrect, the parameter that had dependencies would itself be added before its dependencies causing it to be evaluated with values from a previous iteration.
To Reproduce
Steps to reproduce the behavior:
Run any model that has parameters relations in it, for instance:
study_transient_absorption/transient_absorption_target_analysis.ipynb on main: [transient_absorption_target_analysis.ipynb
](https://github.com/glotaran/pyglotaran-examples/blob/main/pyglotaran_examples/study_transient_absorption/transient_absorption_target_analysis.ipynb) on staging: transient_absorption_target_analysisThen observe that the optimization (given sufficient number of iterations) is following a different trajectory. If no update to the relation parameter happens (e.g. it is fixed, or there are not sufficient iterations/function evaluations possible) you will not see it. Also the first iteration is always idential because the initial parameter values are used.
Important note is that on main the order in which parameters are evlauated is the order in which they were put in the parameters specification file, thus to ensure correctness, relation parameters need to be before the parameters in which they are used in an expresssion.
Expected behavior
Both main and staging follow the same optimization trajectory and arrive at the same final result.
Screenshots
Additional context