1 #include "AllClassWrappers.h"
15 #include <pybind11/pybind11.h>
16 #include <pybind11/stl.h>
17 #include <pybind11/eigen.h>
30 py::class_<MCMCProposal, std::shared_ptr<MCMCProposal>> mcmcPro(m,
"MCMCProposal");
39 py::class_<MHProposal, MCMCProposal, std::shared_ptr<MHProposal>> mhPro(m,
"MHProposal");
42 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::GaussianBase> gauss) {
return new MHProposal(
ConvertDictToPtree(d), prob, gauss);}));
45 py::class_<CrankNicolsonProposal, MCMCProposal, std::shared_ptr<CrankNicolsonProposal>> cnPro(m,
"CrankNicolsonProposal");
48 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::GaussianBase> gauss) {
return new CrankNicolsonProposal(
ConvertDictToPtree(d), prob, gauss);}));
50 py::class_<InverseGammaProposal, MCMCProposal, std::shared_ptr<InverseGammaProposal>>(m,
"InverseGammaProposal")
53 py::class_<AMProposal, MCMCProposal, std::shared_ptr<AMProposal>> amPro(m,
"AMProposal");
56 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, Eigen::MatrixXd
const& cov) {
return new AMProposal(
ConvertDictToPtree(d), prob, cov);} ))
59 py::class_<MALAProposal, MCMCProposal, std::shared_ptr<MALAProposal>>(m,
"MALAProposal")
61 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::GaussianBase>
const& prop) {
return new MALAProposal(
ConvertDictToPtree(d), prob, prop);} ));
63 py::class_<SMMALAProposal, MCMCProposal, std::shared_ptr<SMMALAProposal>>(m,
"SMMALAProposal")
64 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::ModPiece>
const& mod, std::shared_ptr<muq::Modeling::Gaussian>
const& prior,std::shared_ptr<muq::Modeling::Gaussian>
const& likelihood) {
return new SMMALAProposal(
ConvertDictToPtree(d), prob, mod,prior,likelihood);} ));
66 py::class_<InfMALAProposal, MCMCProposal, std::shared_ptr<InfMALAProposal>>(m,
"InfMALAProposal")
68 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::GaussianBase> prop) {
return new InfMALAProposal(
ConvertDictToPtree(d), prob, prop);} ));
70 py::class_<IndependenceProposal, MCMCProposal, std::shared_ptr<IndependenceProposal>>(m,
"IndependenceProposal")
72 .def(py::init( [](py::dict d, std::shared_ptr<AbstractSamplingProblem> prob, std::shared_ptr<muq::Modeling::Distribution> dist) {
return new IndependenceProposal(
ConvertDictToPtree(d), prob, dist);} ));
An implemental of the Adaptive Metropolis algorithm.
virtual void Adapt(unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &states) override
Adapt the proposal after each step.
An implement of the dimension-independent pCN proposal.
Implementation of an independence proposal with arbitrary distribution.
An implement of the dimension-independent MALA (or Inf-MALA) proposal.
Defines a proposal using the analytic conditional Inverse Gamma distribution for the variance of a Ga...
Implementation preconditioned Langevin proposal used in the MALA algorithm.
virtual std::shared_ptr< SamplingState > Sample(std::shared_ptr< SamplingState > const ¤tState)=0
virtual void SetBlockInd(int newBlockInd)
virtual double LogDensity(std::shared_ptr< SamplingState > const &currState, std::shared_ptr< SamplingState > const &propState)=0
virtual int GetBlockInd() const
Implementation of the classic Random Walk Metropolis proposal.
void ProposalWrapper(pybind11::module &m)
boost::property_tree::ptree ConvertDictToPtree(pybind11::dict dict)