Fleet  0.0.9
Inference in the LOT
Public Member Functions | Static Public Member Functions | List of all members
MCMCable< this_t, Args > Class Template Referenceabstract

#include <MCMCable.h>

Inheritance diagram for MCMCable< this_t, Args >:
Inheritance graph
[legend]
Collaboration diagram for MCMCable< this_t, Args >:
Collaboration graph
[legend]

Public Member Functions

 MCMCable ()
 
virtual std::optional< std::pair< this_t, double > > propose () const =0
 
virtual this_t restart () const =0
 
virtual bool operator== (const this_t &h) const =0
 
virtual bool operator!= (const this_t &h) const
 
- Public Member Functions inherited from Bayesable< Args... >
 Bayesable ()
 
virtual size_t hash () const=0
 
virtual std::string string (std::string prefix="") const=0
 
virtual double compute_prior ()=0
 
virtual double compute_single_likelihood (const datum_t &datum)
 Compute the likelihood of a single data point. More...
 
virtual void clear_bayes ()
 
virtual double compute_likelihood (const data_t &data, const double breakout=-infinity)
 Compute the likelihood of a collection of data, by calling compute_single_likelihood on each. This stops if our likelihood falls below breakout. More...
 
virtual double compute_posterior (const data_t &data, const std::pair< double, double > breakoutpair=std::make_pair(-infinity, 1.0))
 Compute the posterior, by calling prior and likelihood. This includes only a little bit of fanciness, which is that if our prior is -inf, then we don't both computing the likelihood. More...
 
virtual double at_temperature (double t) const
 
auto operator (const Bayesable< datum_t, data_t > &other) const
 
virtual void show (std::string prefix="")
 

Static Public Member Functions

static this_t sample ()
 Static function for making a hypothesis. Be careful using this with references because they may not foward right (for reasons that are unclear to me) More...
 

Additional Inherited Members

- Public Types inherited from Bayesable< Args... >
typedef Args... datum_t
 
typedef std::vector< Args... > data_t
 
- Public Attributes inherited from Bayesable< Args... >
double prior
 
double likelihood
 
double posterior
 
uintmax_t born
 
size_t born_chain_idx
 

Detailed Description

template<typename this_t, typename... Args>
class MCMCable< this_t, Args >

Author
steven piantadosi
Date
03/02/20

Constructor & Destructor Documentation

◆ MCMCable()

template<typename this_t, typename... Args>
MCMCable< this_t, Args >::MCMCable ( )
inline

Member Function Documentation

◆ operator!=()

template<typename this_t, typename... Args>
virtual bool MCMCable< this_t, Args >::operator!= ( const this_t &  h) const
inlinevirtual

◆ operator==()

template<typename this_t, typename... Args>
virtual bool MCMCable< this_t, Args >::operator== ( const this_t &  h) const
pure virtual

Implemented in BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >, LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >, LOTHypothesis< MyHypothesis, S, S, MyGrammar, grammar, defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, BindingTree *, bool, MyGrammar, grammar, defaultdatum_t< BindingTree *, bool >, std::vector< defaultdatum_t< BindingTree *, bool > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, utterance, word, MyGrammar, grammar, defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, CL, CL, Combinators::SKGrammar, grammar, defaultdatum_t< CL, CL >, std::vector< defaultdatum_t< CL, CL > >, typename Combinators::SKGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar, grammar, std::multiset< int >, std::vector< std::multiset< int > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, Utterance, TruthValue, MyGrammar, grammar, defaultdatum_t< Utterance, TruthValue >, std::vector< defaultdatum_t< Utterance, TruthValue > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, set, word, MyGrammar, grammar, defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > >, typename MyGrammar ::VirtualMachineState_t >, Lexicon< this_t, _key_t, INNER, _input_t, _output_t, datum_t, _VirtualMachineState_t >, Lexicon< MyHypothesis, std::string, InnerHypothesis, BindingTree *, std::string >, Lexicon< MyHypothesis, S, InnerHypothesis, CL, CL, CLDatum >, Lexicon< MyHypothesis, std::string, InnerHypothesis, ignore_t, ignore_t, Utterance >, VectorHalfNormalHypothesis, VectorNormalHypothesis, TNormalVariable< f >, and TNormalVariable<+[](float x) ->.

◆ propose()

template<typename this_t, typename... Args>
virtual std::optional<std::pair<this_t,double> > MCMCable< this_t, Args >::propose ( ) const
pure virtual

Implemented in BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >, Lexicon< this_t, _key_t, INNER, _input_t, _output_t, datum_t, _VirtualMachineState_t >, Lexicon< MyHypothesis, std::string, InnerHypothesis, BindingTree *, std::string >, Lexicon< MyHypothesis, S, InnerHypothesis, CL, CL, CLDatum >, Lexicon< MyHypothesis, std::string, InnerHypothesis, ignore_t, ignore_t, Utterance >, MyHypothesis, LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >, LOTHypothesis< MyHypothesis, S, S, MyGrammar, grammar, defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, BindingTree *, bool, MyGrammar, grammar, defaultdatum_t< BindingTree *, bool >, std::vector< defaultdatum_t< BindingTree *, bool > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, utterance, word, MyGrammar, grammar, defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, CL, CL, Combinators::SKGrammar, grammar, defaultdatum_t< CL, CL >, std::vector< defaultdatum_t< CL, CL > >, typename Combinators::SKGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar, grammar, std::multiset< int >, std::vector< std::multiset< int > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, Utterance, TruthValue, MyGrammar, grammar, defaultdatum_t< Utterance, TruthValue >, std::vector< defaultdatum_t< Utterance, TruthValue > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, set, word, MyGrammar, grammar, defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > >, typename MyGrammar ::VirtualMachineState_t >, VectorNormalHypothesis, VectorHalfNormalHypothesis, TNormalVariable< f >, TNormalVariable<+[](float x) ->, InnerHypothesis, and InnerHypothesis.

◆ restart()

template<typename this_t, typename... Args>
virtual this_t MCMCable< this_t, Args >::restart ( ) const
pure virtual

Implemented in BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >, BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >, Lexicon< this_t, _key_t, INNER, _input_t, _output_t, datum_t, _VirtualMachineState_t >, Lexicon< MyHypothesis, std::string, InnerHypothesis, BindingTree *, std::string >, Lexicon< MyHypothesis, S, InnerHypothesis, CL, CL, CLDatum >, Lexicon< MyHypothesis, std::string, InnerHypothesis, ignore_t, ignore_t, Utterance >, LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >, LOTHypothesis< MyHypothesis, S, S, MyGrammar, grammar, defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, BindingTree *, bool, MyGrammar, grammar, defaultdatum_t< BindingTree *, bool >, std::vector< defaultdatum_t< BindingTree *, bool > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, utterance, word, MyGrammar, grammar, defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, CL, CL, Combinators::SKGrammar, grammar, defaultdatum_t< CL, CL >, std::vector< defaultdatum_t< CL, CL > >, typename Combinators::SKGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar, grammar, std::multiset< int >, std::vector< std::multiset< int > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< InnerHypothesis, Utterance, TruthValue, MyGrammar, grammar, defaultdatum_t< Utterance, TruthValue >, std::vector< defaultdatum_t< Utterance, TruthValue > >, typename MyGrammar ::VirtualMachineState_t >, LOTHypothesis< MyHypothesis, set, word, MyGrammar, grammar, defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > >, typename MyGrammar ::VirtualMachineState_t >, VectorHalfNormalHypothesis, VectorNormalHypothesis, TNormalVariable< f >, and TNormalVariable<+[](float x) ->.

◆ sample()

template<typename this_t, typename... Args>
static this_t MCMCable< this_t, Args >::sample ( )
inlinestatic

Static function for making a hypothesis. Be careful using this with references because they may not foward right (for reasons that are unclear to me)

Returns

The documentation for this class was generated from the following file: