ebachelet / pyLIMA

GNU General Public License v3.0
31 stars 8 forks source link

Continuing a DE chain by providing initial_population #84

Closed ytsapras closed 1 week ago

ytsapras commented 7 months ago

Not clear what the initial_population format this should be in.

For example, for an fspl model, we have:

>>> fspl.model_dictionnary
OrderedDict([('t0', 0), ('u0', 1), ('tE', 2), ('rho', 3), ('fsource_ASSNG', 4), ('fblend_ASSNG', 5), ('fsource_GaiaG', 6), ('fblend_GaiaG', 7), ('fsource_LCOG', 8), ('fblend_LCOG', 9), ('fsource_LCOI', 10), ('fblend_LCOI', 11), ('fsource_AAVSB', 12), ('fblend_AAVSB', 13), ('fsource_AAVSI', 14), ('fblend_AAVSI', 15), ('fsource_AAVSK', 16), ('fblend_AAVSK', 17), ('fsource_AAVSV', 18), ('fblend_AAVSV', 19)])

and

>>> fit_6.fit_results['DE_population']
array([[ 2.45939696e+06,  5.61385676e-02,  6.46492856e+01, ...,
         4.23969231e+04,  1.07852701e+05,  9.94084105e+05],
       [ 2.45937569e+06,  1.03341459e-01,  9.74261398e+01, ...,
         7.95062578e+04,  6.55168135e+04,  9.34029968e+05],
       [ 2.45938414e+06,  2.38075845e-01,  1.43197868e+02, ...,
         1.62195538e+05, -3.08211683e+04,  7.68837660e+05]])

So how do we structure the input list init_pop so that we can continue the run using:

fit_6.fit(initial_population=init_pop, computational_pool = pool)

ebachelet commented 1 week ago

This is now fixed, sorry for the delay. Just tried on an example with 14 fitted parameters and DE_population_size=1:

aa = DEfit(pspl) aa.fit()

bb = DEfit(pspl) bb.fit(initial_population=aa.fit_results['DE_population][-14:,:14])