lppl
v2.0.0
|
Optimizes a value function and returns the argmax value. More...
#include "query.hpp"
Public Types | |
using | map_fn_t = std::function< V(record_t< DTypes< Ts... > > &, O &, double &w)> |
using | value_fn_t = std::function< double(record_t< DTypes< Ts... > > &, O &, double &w)> |
Public Member Functions | |
Optimizer (map_fn_t map_fn, value_fn_t value_fn) | |
Construct a new Optimizer object. More... | |
void | clear () |
V | emit () |
double | optimum_value () |
Returns the (approximate global) maximum of the value function. More... | |
void | update (record_t< DTypes< Ts... >> &r, O output, double weight, inf_options_t opts) |
Public Member Functions inherited from Queryer< Optimizer, V, O, Ts... > | |
V | emit () |
Emits the result of the query. | |
void | update (record_t< DTypes< Ts... >> &r, O output, double weight, inf_options_t opts) |
Updates the state of the queryer. More... | |
Public Attributes | |
map_fn_t | map_fn |
V | opt |
double | value |
value_fn_t | value_fn |
Optimizes a value function and returns the argmax value.
Given a stream of records \(r\), outputs \(o\), and computed log weights \(w\) from a posterior distribution \(p(z|x)\), a mapping \( v = m(r, o, w) \) from into the value type \(v\), and a value function \(V(r, o, w)\) into the reals, computes the (approximate global) maximum of \(V\) and returns \(v^* = \arg \max_{v = m(r, o, w)} V(r, o, w)\).
V | The type returned by the mapping function |
O | The output type of the probabilistic program |
Ts | The types of distributions in the probabilistic program |