Multi-dimensional Boltzmann sampler.
More...
|
| __init__ (self, model, td_factory=TreeDecompositionFactory(), lazy=True) |
| Construct with model and optional td_factory.
|
|
| is_good_sample (self, features, values) |
| whether the sample is of good quality
|
|
| set_target (self, target, tolerance, featureid) |
| Set target of a feature.
|
|
| targeted_samples (self) |
| Generator of targeted samples.
|
|
| targeted_sample (self) |
|
| __init__ (self, model, td_factory=TreeDecompositionFactory(), lazy=True) |
| Construct.
|
|
| sample (self) |
| Generate sample.
|
|
| resample (self, variables, assignment) |
| Generate sample.
|
|
| samples (self) |
| Sample generator.
|
|
| gen_cluster_tree (self) |
| Suitable cluster tree.
|
|
| __init__ (self, model, td_factory=TreeDecompositionFactory(), lazy=True) |
| Construct with model and optional td_factory.
|
|
| requires_reinitialization (self) |
|
| setup_engine (self, *skip_ct=False) |
| Sets up the constraint model / cluster tree sampling engine.
|
|
| evaluate (self) |
| Evaluates the cluster tree.
|
|
| is_consistent (self) |
|
| plot_td (self, filename, to="pdf") |
| Plot the tree decomposition to pdf file filename write to filename to target format, support conversion to "pdf" or "png".
|
|
| treewidth (self) |
| Get tree width.
|
|
| gen_cluster_tree (self) |
| Generate the populated cluster tree td tree decomposition Returns cluster tree.
|
|
Multi-dimensional Boltzmann sampler.
◆ __init__()
infrared.infrared.MultiDimensionalBoltzmannSampler.__init__ |
( |
|
self, |
|
|
|
model, |
|
|
|
td_factory = TreeDecompositionFactory() , |
|
|
|
lazy = True |
|
) |
| |
Construct with model and optional td_factory.
- Parameters
-
model | [const] Constraint network Model |
td_factory | Factory for tree decomposition |
lazy | delay construction of the data structures until required. Defaults to True |
BoltzmannSampler.__init__()
Reimplemented from infrared.infrared.BoltzmannSampler.
◆ is_good_sample()
infrared.infrared.MultiDimensionalBoltzmannSampler.is_good_sample |
( |
|
self, |
|
|
|
features, |
|
|
|
values |
|
) |
| |
whether the sample is of good quality
checks whether the sample approximately meets the targets;
check only the targeted features (which have value, target and tolerance)
- Parameters
-
features | dictionary of features |
◆ rmsd()
infrared.infrared.MultiDimensionalBoltzmannSampler.rmsd |
( |
|
means, |
|
|
|
features |
|
) |
| |
|
static |
◆ set_target()
infrared.infrared.MultiDimensionalBoltzmannSampler.set_target |
( |
|
self, |
|
|
|
target, |
|
|
|
tolerance, |
|
|
|
featureid |
|
) |
| |
Set target of a feature.
- Parameters
-
target | the target value |
tolerance | the tolerance (as absolute difference) to the target |
fetureid | id of the feature |
◆ targeted_sample()
infrared.infrared.MultiDimensionalBoltzmannSampler.targeted_sample |
( |
|
self | ) |
|
◆ targeted_samples()
infrared.infrared.MultiDimensionalBoltzmannSampler.targeted_samples |
( |
|
self | ) |
|
Generator of targeted samples.
Performs multi-dimensional Boltzmann sampling: every
self.samples_per_round many samples, the feature means are
estimated and the weights are recalibrated. Each generated
sample is tested for falling into target +/- tolerance for all
features, in which case it is yielded.
self.tweak_factor controls the scale of weight recalibration in each round.
self.cooling is a multiplier for the tweak factor to reduce it when
the rmsd of means to target increases (with the purpose to stabilize
the optimization)
self.callback callback function, called after each round with
round statistics (FeatureStatistics)
◆ _targeted_samples
infrared.infrared.MultiDimensionalBoltzmannSampler._targeted_samples |
|
protected |
◆ callback
infrared.infrared.MultiDimensionalBoltzmannSampler.callback |
◆ cooling
infrared.infrared.MultiDimensionalBoltzmannSampler.cooling |
◆ samples_per_round
infrared.infrared.MultiDimensionalBoltzmannSampler.samples_per_round |
◆ tweak_factor
infrared.infrared.MultiDimensionalBoltzmannSampler.tweak_factor |
◆ verbose
infrared.infrared.MultiDimensionalBoltzmannSampler.verbose |
The documentation for this class was generated from the following file: