-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsamplers.py
31 lines (27 loc) · 1.02 KB
/
samplers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 16:05:58 2015
@author: s1050238
"""
from model_utilities import ProPPAException
from finite_metropolis_sampler import FiniteMetropolisSampler
from finite_state_gibbs import RaoTehGibbsSampler
from fluid_sampler import FluidSampler
from lna_sampler import LNASampler
from roulette_metropolis_sampler import RouletteMetropolisSampler
from abc_sampler import ABCSampler
from enhanced_abc_sampler import EnhancedABCSampler
sampler_dict = {'direct': FiniteMetropolisSampler,
'gibbs': RaoTehGibbsSampler,
'roulette-mh': RouletteMetropolisSampler,
'ode': FluidSampler,
'fluid' : FluidSampler,
'lna': LNASampler,
'abc': ABCSampler,
'abc_enhanced': EnhancedABCSampler,
'enhanced_abc': EnhancedABCSampler}
def get_sampler(name):
try:
return sampler_dict[name.lower()]
except KeyError:
raise ProPPAException("Unrecognised inference algorithm: " + name)