Infrared
Loading...
Searching...
No Matches
infrared.infrared.BoltzmannSampler Class Reference

Boltzmann sampler. More...

Inheritance diagram for infrared.infrared.BoltzmannSampler:
Collaboration diagram for infrared.infrared.BoltzmannSampler:

Public Member Functions

 __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.
 
- Public Member Functions inherited from infrared.infrared.EngineBase
 __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.
 

Protected Attributes

 _model
 
- Protected Attributes inherited from infrared.infrared.EngineBase
 _model
 
 _td_factory
 
 _td
 
 _ct
 

Additional Inherited Members

- Properties inherited from infrared.infrared.EngineBase
 model = property
 
 td = property
 
 ct = property
 

Detailed Description

Boltzmann sampler.

Constructor & Destructor Documentation

◆ __init__()

infrared.infrared.BoltzmannSampler.__init__ (   self,
  model,
  td_factory = TreeDecompositionFactory(),
  lazy = True 
)

Construct.

Parameters
modelInfrared Model
td_factoryTree decomposition policy. Defaults to TreeDecompositionFactory
lazyDefaults to True
See also
EngineBase

Reimplemented from infrared.infrared.EngineBase.

Reimplemented in infrared.infrared.MultiDimensionalBoltzmannSampler.

Member Function Documentation

◆ gen_cluster_tree()

infrared.infrared.BoltzmannSampler.gen_cluster_tree (   self)

Suitable cluster tree.

Returns
PFClusterTree for the model

Reimplemented from infrared.infrared.EngineBase.

◆ resample()

infrared.infrared.BoltzmannSampler.resample (   self,
  variables,
  assignment 
)

Generate sample.

   If the cluster tree was not evaluated (or consistency checked) before,
   it will be evaluated once on-demand.
Returns
a raw sample
Note
raises exception ConsistencyError if the model is inconsistent.

◆ sample()

infrared.infrared.BoltzmannSampler.sample (   self)

Generate sample.

   If the cluster tree was not evaluated (or consistency checked) before,
   it will be evaluated once on-demand.
Returns
a raw sample
Note
raises exception ConsistencyError if the model is inconsistent.

◆ samples()

infrared.infrared.BoltzmannSampler.samples (   self)

Sample generator.

Member Data Documentation

◆ _model

infrared.infrared.BoltzmannSampler._model
protected

The documentation for this class was generated from the following file: