alex.ml.bn package¶
Submodules¶
alex.ml.bn.autopath module¶
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need to be run, typically all of the test subdirs. The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing “pypy” is in sys.path.
If you modify the master “autopath.py” version (in pypy/tool/autopath.py) you can directly run it which will copy itself on all autopath.py files it finds under the pypy root directory.
This module always provides these attributes:
pypydir pypy root directory path this_dir directory where this autopath.py resides
alex.ml.bn.factor module¶
alex.ml.bn.lbp module¶
Belief propagation algorithms for factor graph.
- class alex.ml.bn.lbp.LBP(strategy='sequential', **kwargs)[source]¶
Bases: alex.ml.bn.lbp.BP
Loopy Belief Propagation.
LBP is an approximative inference algorithm for factor graphs. LBP works with generic factor graphs. It does accurate inference for trees and is equal to sum-product algorithm there.
It is possible to specify which strategy should be used for choosing next node for update. Sequential strategy will update nodes in exact order in which they were added. Tree strategy will assume the graph is a tree (without checking) and will do one pass of sum-product algorithm.
- exception alex.ml.bn.lbp.LBPError[source]¶
Bases: alex.ml.bn.lbp.BPError