lppl  v0.11.0
LikelihoodWeighting< I, O, V, Q, Ts > Struct Template Reference

Likelihood weighting importance sampling, using the prior as the proposal. More...

#include "likelihood.hpp"

Inheritance diagram for LikelihoodWeighting< I, O, V, Q, Ts >:
Inference< LikelihoodWeighting, I, O, V, Q, Ts... >

Public Member Functions

operator() (I &input)
 
void step (record_t< Ts... > &r, I &input)
 
- Public Member Functions inherited from Inference< LikelihoodWeighting, I, O, V, Q, Ts... >
 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

- Public Attributes inherited from Inference< LikelihoodWeighting, I, O, V, Q, Ts... >
pp_t< I, O, Ts... > f
 
inf_options_t opts
 
Q< V, O, Ts... > & queryer
 

Detailed Description

template<typename I, typename O, typename V, template< class, class, class... > class Q, typename... Ts>
struct LikelihoodWeighting< I, O, V, Q, Ts >

Likelihood weighting importance sampling, using the prior as the proposal.

Suppose the probabilistic program factors as \(p(x,z) = p(x|z)p(z)\). This method samples values \(z \sim p(z)\). The weight of each sample is given by \(\log w = \log p(x|z)\).

Template Parameters
IThe input type of the probabilistic program
OThe output type of the probabilistic program
VThe type of the address(es) to be queried
QThe class template of the queryer
TsThe distribution types in the probabilistic program

The documentation for this struct was generated from the following file: