def __init__(self,dataset,model_name,num_obs_vars,m='0',r1='1', lbp_iters=3000):
    # TODO: experiment with different values of fastinf

    self.dataset = dataset
    self.fd = FastinfDiscretizer(self.dataset, model_name)
    self.res_fname = config.get_fastinf_res_file(dataset,model_name,m,r1)

    # TODO: experiment with different amounts of smoothing
    # amount of smoothing is correlated with fastinf slowness, values [0,1)
    self.smoothing = 0.5
    self.cache_fname = config.get_fastinf_cache_file(dataset,model_name,m,r1,self.smoothing)

    if os.path.exists(self.cache_fname):
      with open(self.cache_fname) as f:
        print("Loading fastinf cache from file")
        self.cache = cPickle.load(f)
    else:
      self.cache = {}
    self.cmd = config.fastinf_bin+" -i %s -m 0 -Is %f -Imm %d"%(self.res_fname, self.smoothing, lbp_iters)
    self.num_obs_vars = num_obs_vars
    self.tt = TicToc().tic()
    self.process = pexpect.spawn(self.cmd)
    self.blacklist = []
  
    marginals = self.get_marginals()
    print("FastinfModel: Computed initial marginals in %.3f sec"%self.tt.qtoc())