leaspy.algo.algo_with_samplers¶
Classes¶
Mixin class to use in algorithms that require samplers. |
Module Contents¶
- class AlgorithmWithSamplersMixin(settings)[source]¶
Mixin class to use in algorithms that require samplers.
Note that this mixin should be used with a class inheriting from AbstractAlgo, which must have algo_parameters attribute.
- Parameters:
- settings
AlgorithmSettings The specifications of the algorithm as a
AlgorithmSettingsinstance.- Please note that you can customize the number of memory-less (burn-in) iterations by setting either:
n_burn_in_iter_frac, such that duration of burn-in phase is a ratio of algorithm n_iter (default of 90%)
- settings
- Attributes:
- samplers
dict[str,AbstractSampler] Dictionary of samplers per each variable
- current_iteration
int, default 0 Current iteration of the algorithm. The first iteration will be 1 and the last one n_iter.
- random_order_variables
bool(default True) This attribute controls whether we randomize the order of variables at each iteration. Article https://proceedings.neurips.cc/paper/2016/hash/e4da3b7fbbce2345d7772b0674a318d5-Abstract.html gives a rationale on why we should activate this flag.
- samplers
- Parameters:
settings (AlgorithmSettings)
- samplers: dict[str, AbstractSampler] = None¶