autoppl
v0.8
A C++ template library for probabilistic programming
|
Go to the documentation of this file.
11 template <
class AdapterPolicy>
30 template <
class MatType
32 void sample(Eigen::MatrixBase<MatType>& rho,
35 rho = MatType::NullaryExpr(rho.rows(),
36 [&]() { return dist(gen); });
42 template <
class MatType>
43 double kinetic(
const Eigen::MatrixBase<MatType>& rho)
const
44 {
return 0.5 * rho.squaredNorm(); }
46 template <
class MatType>
51 std::normal_distribution<> dist;
66 , m_inverse_(n_params)
74 template <
class MatType
76 void sample(Eigen::MatrixBase<MatType>& rho,
79 rho = MatType::NullaryExpr(rho.rows(),
80 [&]() { return dist(gen); });
81 rho.array() /= m_inverse_.array().sqrt();
87 template <
class MatType>
88 double kinetic(
const Eigen::MatrixBase<MatType>& rho)
const
89 {
return 0.5 * rho.dot(dkinetic_dr(rho)); }
91 template <
class MatType>
93 {
return (m_inverse_.array() * rho.array()).matrix(); }
99 std::normal_distribution<> dist;
100 variance_t m_inverse_;
const variance_t & get_m_inverse() const
Definition: momentum_handler.hpp:96
variance_t & get_m_inverse()
Definition: momentum_handler.hpp:95
double kinetic(const Eigen::MatrixBase< MatType > &rho) const
Definition: momentum_handler.hpp:88
Definition: var_adapter.hpp:9
double kinetic(const Eigen::MatrixBase< MatType > &rho) const
Definition: momentum_handler.hpp:43
void sample(Eigen::MatrixBase< MatType > &rho, GenType &gen)
Definition: momentum_handler.hpp:76
MomentumHandler(size_t=0)
Definition: momentum_handler.hpp:23
MomentumHandler(size_t n_params)
Definition: momentum_handler.hpp:64
Definition: momentum_handler.hpp:12
void sample(Eigen::MatrixBase< MatType > &rho, GenType &gen)
Definition: momentum_handler.hpp:32
Definition: var_adapter.hpp:10
Eigen::VectorXd variance_t
Definition: momentum_handler.hpp:61
const MatType & dkinetic_dr(const MatType &rho) const
Definition: momentum_handler.hpp:47
Definition: bounded.hpp:11
auto dkinetic_dr(const Eigen::MatrixBase< MatType > &rho) const
Definition: momentum_handler.hpp:92