lppl
v0.14.4
|
A generic filtering inference algorithm. More...
#include "filter.hpp"
Public Member Functions | |
Filter (pp_t< I, O, Ts... > f, FilterQueryerType< O, Ts... > &queryer, transition< TransKernel, O, Ts... > &trans, inf_options_t opts, size_t seed=2022) | |
Construct a new Filter object. More... | |
template<template< typename, typename, typename, template< class, class, class... > class, typename... > class G = A> | |
std::enable_if_t< has_proposal< G >::value==kernel::none, FilterValueType< O, Ts... > > | step (I &input) |
Executes one filtering step. More... | |
template<class P , template< typename, typename, typename, template< class, class, class... > class, typename... > class G = A> | |
std::enable_if_t< has_proposal< G >::value==kernel::full, FilterValueType< O, Ts... > > | step (I &input, P &proposal) |
Executes one filtering step. More... | |
void | update_internal_state (FilterValueType< O, Ts... > &posterior) |
Public Attributes | |
bool | has_been_called |
std::minstd_rand | rng |
transition< TransKernel, O, Ts... > & | trans |
Additional Inherited Members | |
![]() | |
Inference (pp_t< I, O, Ts... > f, WeightedRecord< FilterValueType< O, Ts... >, O, Ts... > &queryer, inf_options_t opts) | |
std::enable_if_t< has_proposal< G >::value==kernel::none, FilterValueType< O, Ts... > > | operator() (I &input) |
Runs the specified inference algorithm with the specified queryer. More... | |
std::enable_if_t< has_proposal< G >::value==kernel::full, FilterValueType< O, Ts... > > | 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, FilterValueType< O, Ts... > > | 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... | |
![]() | |
pp_t< I, O, Ts... > | f |
inf_options_t | opts |
WeightedRecord< FilterValueType< O, Ts... >, O, Ts... > & | queryer |
A generic filtering inference algorithm.
Given a probabilistic program \(p(x,z) = p(x|z)p(z)\) and a user-supplied transition kernel, the model is converted into a dynamic filtering model \( p(x,z) = p(x_1 | z_1) p(z_1) \prod_{t\geq 2} p(x_t | z_t)p(z_t|x_{t-1}, z_{t-1})\) using filter_effect. At each timestep, inference is performed using the user-specified inference algorithm to recover an approximate posterior \(p(z_t | x_t)\). That approximate posterior is consumed by the transition callable to generate the new transition dynamics \(p(z_{t+1}|x_t, z_t)\) used in the next filtering step.
A | The class template of the inference algorithm to use in constructing the approximate posterior |
I | The input type of the probabilistic program |
O | The output type of the probabilistic program |
Ts | The types of the distributions in the probabilistic program |