autoppl  v0.8
A C++ template library for probabilistic programming
ppl::expr Namespace Reference

Namespaces

 constraint
 
 dist
 
 model
 
 prog
 
 var
 

Functions

template<class ExprType >
auto activate (ExprType &&expr)
 
template<class ProgramType , class GenType >
void init_params (ProgramType &program, GenType &gen, bool prune=true, double radius=2.)
 

Function Documentation

◆ activate()

template<class ExprType >
auto ppl::expr::activate ( ExprType &&  expr)
inline

Activates expr with the correct offset values for each parameter and then activates the reference counts for each of the parameters. The total reference count for a parameter should be the number of ParamView objects referencing that parameter in the expression. Every inference algorithm must invoke this call. Otherwise, undefined behavior.

Template Parameters
ExprTypetype of expression
Parameters
exprexpression to set parameter offsets
Returns
offset packs of continuous and discrete parameters, respectively

◆ init_params()

template<class ProgramType , class GenType >
void ppl::expr::init_params ( ProgramType &  program,
GenType &  gen,
bool  prune = true,
double  radius = 2. 
)
inline

Initializes parameters with the given priors and conditional distributions based on the model. Random numbers are generated with gen. Assumes that model was activated and bound before. It only requires binding:

  • unconstrained
  • constrained
  • visit count
  • transformed parameter values