lppl  v2.0.0
query.hpp File Reference
#include <cstddef>
#include <initializer_list>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <distribution_traits.hpp>
#include <record.hpp>

Classes

struct  collection_t
 
struct  ProductGenerator< Impl, V, O, Ts >::EmitType
 Product of values (mapping from address to result type of underlying queryer) and distributions (mapping from address to first-encountered distribution at that address) More...
 
struct  inf_options_t
 Options used by all inference algorithms. More...
 
struct  LogSumExpQ< typename, O, Ts >
 Computes a streaming log-sum-exp. More...
 
struct  Optimizer< V, O, Ts >
 Optimizes a value function and returns the argmax value. More...
 
struct  ProductGenerator< Impl, V, O, Ts >
 Generates a queryer that returns a fully factored collection of views. More...
 
struct  ProductGenerator< Impl, V, O, Ts >::Q< typename, typename,... >
 A queryer that emits \(V[p(z|x)] = \prod_a V[p(z_a|x)]\). More...
 
struct  Queryer< Impl, V, O, Ts >
 Interface to all querying mechanisms for sample-based inference (and possibly other inference algorithms). Much computation that is associated with inference is implemented by subclasses of Queryer (rather than in inference algorithms themselves, as is often done). More...
 
struct  record_collection_t< O, Ts >
 Collects records generated by an inference algorithm into an empirical posterior distribution over records and output values. More...
 
struct  value_collection_t< V >
 A collection of sampled values. More...
 
struct  Weighted< V, O, Ts >
 Access to all sample weights. More...
 
class  WeightedMean< typename, O, Ts >
 Computes the mean of the specified sample site with O(1) memory. More...
 
struct  WeightedMeanStd< typename, O, Ts >
 Computes the mean and standard deviation of the specified sample site with O(1) memory. More...
 
class  WeightedRecord< typename, O, Ts >
 A collection of weighted records. More...
 
class  WeightedValue< std::unique_ptr< value_collection_t< V > >, O, Ts... >
 

Typedefs

template<typename V , typename O , template< class, class, class... > class Q, typename... Ts>
using queryer_map_t = std::unordered_map< std::string, std::shared_ptr< Q< V, O, Ts... > >>
 

Functions

template<typename O , typename... Ts>
auto log_sum_exp_q ()
 
double logsumexp_streaming (double &_alpha, double &_r, const double &weight)
 streaming logsumexp computation, see https://arxiv.org/abs/1805.02867 More...
 
template<typename O , typename... Ts>
auto weighted_mean (std::string address)
 factory function for WeightedMean
 
template<typename O , typename... Ts>
auto weighted_mean_std (std::string address)
 
template<typename O , typename... Ts>
auto weighted_record ()
 Factory function for WeightedRecord.
 
template<typename V , typename O , typename... Ts>
auto weighted_value (std::string address)
 Factory function for WeightedValue.
 

Detailed Description

This file is part of fmcs. Copyright David Rushing Dewhurst, 2022 - present. Some rights reserved.