lppl
v0.11.0
|
Importance sampling using an arbitrary user-defined proposal distribution. More...
#include "generic.hpp"
Public Member Functions | |
template<typename P > | |
V | operator() (I &input, P &proposal) |
template<typename P > | |
void | step (record_t< Ts... > &r, I &input, P &proposal) |
![]() | |
Inference (pp_t< I, O, Ts... > f, Q< V, O, Ts... > &queryer, inf_options_t opts) | |
std::enable_if_t< has_proposal< G >::value==kernel::none, V > | operator() (I &input) |
Runs the specified inference algorithm with the specified queryer. More... | |
std::enable_if_t< has_proposal< G >::value==kernel::full, V > | operator() (I &input, P &proposal) |
Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More... | |
std::enable_if_t< has_proposal< G >::value==kernel::partial, V > | operator() (I &input, pp_t< record_t< Ts... >, double, Ts... > &proposal) |
Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More... | |
Additional Inherited Members | |
![]() | |
pp_t< I, O, Ts... > | f |
inf_options_t | opts |
Q< V, O, Ts... > & | queryer |
Importance sampling using an arbitrary user-defined proposal distribution.
Suppose the probabilistic program factors as \(p(x, z) = p(x|z)p(z)\), while the proposal distribution is given by \(q(z|x)\). This method proposes values \(z \sim q(z|x)\) and computes weights as \( \log w = \log p(x,z) - \log q(z|x)\).
I | The input type of the probabilistic program |
O | The output type of the probabilistic program |
V | The type of the address(es) to be queried |
Q | The class template of the queryer |
Ts | The distribution types in the probabilistic program |