CUQI-DTU / CUQIpy

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

Iterate on get_state and set_state handling in experimental mcmc module #402

Closed nabriis closed 5 months ago

nabriis commented 5 months ago

Issue Current implementation of get_state and set_state is handled in each subclass of SamplerNew and not tested. This issue is to address this by implementing get_state and set_state in the base class and add unit tests. It is another problem to re-consider/refactor this design. For that see #379.

Proposed solution 1) Implement a datastructure that can contain keys to variables that currently constitute the state of each of the subclassing samplers. The subclassing samplers should be able to modify this datastructure in a simple way and clear way when/if they add new variables to be stored as state.

2) Implement the functionality of get_state and set_state in the base class and delete it from subclasses.

3) Add unit tests on get_state, set_state and checkpointing.