Skip to content

Learn a Factor Graph, or Markov Random Field (MRF), from data/observations. I.e. do PGM parameter learning.

License

Notifications You must be signed in to change notification settings

salvaRC/Factor-Graph-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Factor graph/MRF parameter learning/estimation package via stochastic maximum likelihood

The current implementation only supports binary variables, with values in e.g. {-1, +1} and uses some Numba to speed up the Numpy-based algorithms (by a little bit) -- there are certainly more potential speed-ups :)

Dependencies

Currently only tested with Python3.7:

conda create -n my-fg python=3.7
conda activate my-fg
pip install -r requirements.txt

Expected Factor Graph Definition

The package assumes the MRF to be in exponential form, that is the distribution over the random variables can be written as:

where is the partition function (a normalization constant), are the model's parameter, and are the sufficient statistics/factors/potentials.

Example

If you want to see/run the example: click here. And, if you want to compare to Snorkel you need to install it as follows: pip install snorkel

About

Learn a Factor Graph, or Markov Random Field (MRF), from data/observations. I.e. do PGM parameter learning.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages