Fleet  0.0.9
Inference in the LOT
Namespaces | Functions
Proposers.h File Reference
#include <optional>
#include <utility>
#include <tuple>
#include "Node.h"
Include dependency graph for Proposers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Proposals
 

Functions

double Proposals::can_resample (const Node &n)
 Helper function for whether we can resample from a node (just accesses n.can_resample) More...
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::prior_proposal (GrammarType *grammar, const Node &from)
 
template<typename GrammarType >
double Proposals::p_regeneration_propose_to (GrammarType *grammar, const Node &a, const Node &b)
 Probability of proposing from a to b under regeneration. More...
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::regenerate (GrammarType *grammar, const Node &from)
 A little helper function that resamples everything below when we can. If we can't, then we'll recurse. More...
 
template<typename GrammarType , int D>
std::optional< std::pair< Node, double > > Proposals::regenerate_shallow (GrammarType *grammar, const Node &from)
 Regenerate with rational-rules style proposals, but only allow proposals to trees with a max depth of D. This encourages smaller changes, but also gets you stuck pretty bad in local maxima since you can't take big hops. Probably will work best with restarts. More...
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::insert_tree (GrammarType *grammar, const Node &from)
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::delete_tree (GrammarType *grammar, const Node &from)
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::sample_function_leaving_args (GrammarType *grammar, const Node &from)
 This samples functions f(a,b) -> g(a,b) (e.g. without destroying what's below). This uses a little trick that the node only stores the rule, so we can swap it out if we want. More...
 
template<typename GrammarType >
std::optional< std::pair< Node, double > > Proposals::swap_args (GrammarType *grammar, const Node &from)
 This propose swaps around arguments of the same type. More...