The goal of this third exercise is to understand and implement three different generic inference algorithms: importance sampling (IS), Metropolis Hastings within Gibbs (MH Gibbs), and Hamiltonian Monte Carlo (HMC).
Note: This code base was developed on Python3.7
Clone Daphne directly into this repo:
git clone git@github.com:plai-group/daphne.git
(To use Daphne you will need to have both a JVM installed and Leiningen installed)
pip3 install -r requirements.txt
- Change the daphne path in
evaluation_based_sampling.py
and run:
python3 evaluation_based_sampling.py
- (IS) Change the daphne path in
graph_based_sampling.py
and run:
python3 evaluation_based_sampling.py
- (MH Gibbs) Change the daphne path in
MH-gibbs.py
and run:
python3 MH-gibbs.py
- (HMC) Change the daphne path in
HMC.py
and run:
python3 HMC.py