CobayaSampler / cobaya

Code for Bayesian Analysis
http://cobaya.readthedocs.io/en/latest/
Other
126 stars 125 forks source link

Option to relax some consitency checks at resume (was "YOLO mode") #325

Closed mraveri closed 1 month ago

mraveri commented 11 months ago

The function is_equal_info gives me all sorts of portability problems when doing its checks, which are possibly too strict.

For example, I am using modified camb codes, which have different paths on a cluster and on my local machine and I cannot resume runs / minimize across the two because the two paths are formally different.

Is it possible to have a flag to disable/weaken these types of checks? Or to raise a warning instead of stopping?

mraveri commented 11 months ago

Also when changing sampling options mid-run (which is very useful, especially for exploratory runs) the code complains and stops (although I could not trace it to is_equal_info)

JesusTorrado commented 11 months ago

Hi @mraveri

Seems doable, and an option for a warning seems reasonable. I'll take a look during next week.

About the second one, which sampling options in particular and for which sampler? Because not all of them can in practice be changed mid sampling. An MVE would help!

cmbant commented 11 months ago

I agree that these tests can be annoying and a bit inflexible.

Another possibility is something like a --start-from option to use current param values and covmat and nothing else (like minimize), then overwrite existing chains or write new ones if given different name (e.g. allowing initial fast exploration using an approximate theory or sampler, then switching to using an accurate calculation for final samples).

cmbant commented 1 month ago

For the moment, I just tried adding an --allow-changes option to skip the info consistency check (https://github.com/CobayaSampler/cobaya/pull/374). Does this work for you?