1 #ifndef OPENGM_LIBDAI_MEAN_FIELD_HXX
2 #define OPENGM_LIBDAI_MEAN_FIELD_HXX
21 template<
class GM,
class ACC>
40 return "libDAI-Mean-Field";
45 const size_t maxiter=10000,
46 const double damping=0.0,
47 const double tolerance=1e-9,
50 const size_t verbose=0
90 return this->graphicalModel_impl();
94 return this->reset_impl();
98 return this->infer_impl();
101 template<
class VISITOR>
103 visitor.begin(*
this);
110 throw opengm::RuntimeError(
"MeanField implementation in libdai doesn't have member function findMaximum(), hence opengm::external::libdai::MeanField::arg() can't be used.");
111 return this->arg_impl(v,argnr);
114 return this->marginal_impl(v,m);
117 return this->factorMarginal_impl(f,m);
126 #endif // OPENGM_LIBDAI_MEAN_FIELD_HXX
std::string toString() const
MeanField(const GM &gm, const Parameter param=Parameter())
virtual InferenceTermination infer()
virtual InferenceTermination arg(std::vector< LabelType > &v, const size_t argnr=1) const
output a solution
virtual const GraphicalModelType & graphicalModel() const
virtual InferenceTermination marginal(const size_t v, IndependentFactorType &m) const
output a solution for a marginal for a specific variable
InferenceTermination infer(VISITOR &visitor)
Inference algorithm interface.
Parameter(const size_t maxiter=10000, const double damping=0.0, const double tolerance=1e-9, const UpdateRule updateRule=NAIVE, const Init init=UNIFORM, const size_t verbose=0)
virtual InferenceTermination factorMarginal(const size_t f, IndependentFactorType &m) const
output a solution for a marginal for all variables connected to a factor
opengm::visitors::EmptyVisitor< MeanField< GM, ACC > > EmptyVisitorType
GraphicalModelType::IndependentFactorType IndependentFactorType