CUQI-DTU / CUQIpy

https://cuqi-dtu.github.io/CUQIpy/
Apache License 2.0
48 stars 9 forks source link

Refactor and fix "get_state" and "set_state" in MCMC module #379

Open nabriis opened 8 months ago

nabriis commented 8 months ago

Currently we store "current_point", "current_target_eval" etc. as seperate attributes often as CUQIarray even if scalar in the new experiemental MCMC module. This is not good design and will likely even create bugs. As suggested in #356, let us refactor this behavior of the sampler "state" (e.g. all variables that define the current state) and design a good implementation.

On a related note we also have the sampler history e.g. "samples", "acceptance rate" etc.

Both state and history need to have a good approach for loading and saving. This is currently implemented as "checkpoint" for state and "batch" for history. But it needs a proper re-design.

Here are some points to address for this refactor as discussed in #390.

Allow Save State and Save History in HybridGibbs