glotaran / pyglotaran

A Python library for Global and Target Analysis of time-resolved spectroscopy data
GNU Lesser General Public License v3.0
53 stars 18 forks source link

[staging] 🐛 Optimization does not work with dataset scale parameters #1463

Closed jsnel closed 2 months ago

jsnel commented 3 months ago

Version information

Describe the bug

An optimization involving an experiment with multiple datasets and scaling parameters (of which (n-1) should be estimated) does not currently optimize correctly.

To Reproduce

Steps to reproduce the behavior:

Run sim_analysis_script_3d_disp.ipynb (e.g. here)

Observed behavior

Optimization

   Iteration     Total nfev        Cost      Cost reduction    Step norm     Optimality   
       0              1         2.8053e+06                                    5.62e+06    
       1              2         1.5353e+06      1.27e+06       4.74e+00       3.15e+06    
       2              3         6.2623e+05      9.09e+05       4.74e+00       2.38e+06    
       3              5         3.2530e+05      3.01e+05       1.19e+00       2.34e+05    
The maximum number of function evaluations is exceeded.
Function evaluations 5, initial cost 2.8053e+06, final cost 3.2530e+05, first-order optimality 2.34e+05.

First plot image

Expected behavior

   Iteration     Total nfev        Cost      Cost reduction    Step norm     Optimality   
       0              1         8.2822e+00                                    8.54e+03    
       1              2         8.0162e-05      8.28e+00       3.09e-03       9.46e+00    
       2              3         7.3664e-05      6.50e-06       2.23e-05       1.67e-04    
       3              4         7.3664e-05      0.00e+00       0.00e+00       1.67e-04    
`xtol` termination condition is satisfied.
Function evaluations 4, initial cost 8.2822e+00, final cost 7.3664e-05, first-order optimality 1.67e-04.

Expected result (first plot_ image

Extra information

A PR ( #1461 ) was created which fixes the issues, but there may be a better way.

jsnel commented 2 months ago

This was fixed on staging with #1461