Fleet  0.0.9
Inference in the LOT
Public Types | Public Member Functions | Static Public Member Functions | List of all members
MyHypothesis Class Referencefinal
Inheritance diagram for MyHypothesis:
Inheritance graph
[legend]
Collaboration diagram for MyHypothesis:
Collaboration graph
[legend]

Public Types

using Super = Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
 
using Super = LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
 
using Super = LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
 
using Super = LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
 
using Super = LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
 
using Super = LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
 
- Public Types inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
typedef Bayesable< defaultdatum_t< D, D >, std::vector< defaultdatum_t< D, D > > >::datum_t datum_t
 
typedef Bayesable< defaultdatum_t< D, D >, std::vector< defaultdatum_t< D, D > > >::data_t data_t
 
using Grammar_t = MyGrammar
 
using input_t = D
 
using output_t = D
 
using VirtualMachineState_t = typename MyGrammar ::VirtualMachineState_t
 
- Public Types inherited from Bayesable< Args... >
typedef Args... datum_t
 
typedef std::vector< Args... > data_t
 
- Public Types inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
typedef Bayesable< defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > > >::datum_t datum_t
 
typedef Bayesable< defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > > >::data_t data_t
 
using Grammar_t = MyGrammar
 
using input_t = S
 
using output_t = S
 
using VirtualMachineState_t = typename MyGrammar ::VirtualMachineState_t
 
- Public Types inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
typedef Bayesable< std::multiset< int >, std::vector< std::multiset< int > > >::datum_t datum_t
 
typedef Bayesable< std::multiset< int >, std::vector< std::multiset< int > > >::data_t data_t
 
using Grammar_t = MyGrammar
 
using input_t = int
 
using output_t = NumberSet
 
using VirtualMachineState_t = typename MyGrammar ::VirtualMachineState_t
 
- Public Types inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
typedef Bayesable< defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > > >::datum_t datum_t
 
typedef Bayesable< defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > > >::data_t data_t
 
using Grammar_t = MyGrammar
 
using input_t = set
 
using output_t = word
 
using VirtualMachineState_t = typename MyGrammar ::VirtualMachineState_t
 
- Public Types inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
typedef Bayesable< defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > > >::datum_t datum_t
 
typedef Bayesable< defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > > >::data_t data_t
 
using Grammar_t = MyGrammar
 
using input_t = utterance
 
using output_t = word
 
using VirtualMachineState_t = typename MyGrammar ::VirtualMachineState_t
 
- Public Types inherited from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
using Grammar_t = typename InnerHypothesis ::Grammar_t
 
using input_t = S
 
using output_t = S
 
using VirtualMachineState_t = typename InnerHypothesis ::Grammar_t::VirtualMachineState_t
 

Public Member Functions

virtual DiscreteDistribution< Scall (const S x, const S &err=S{})
 Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls. More...
 
virtual double compute_single_likelihood (const datum_t &datum) override
 Compute the likelihood of a single data point. More...
 
double compute_likelihood (const data_t &data, const double breakout=-infinity) override
 Compute the likelihood of a collection of data, by calling compute_single_likelihood on each. This stops if our likelihood falls below breakout. More...
 
void print (std::string prefix="") override
 
double compute_prior () override
 Compute the prior – defaultly not defined. More...
 
DiscreteDistribution< wordcall (const utterance &input)
 
double compute_single_likelihood (const datum_t &d) override
 Compute the likelihood of a single data point. More...
 
virtual void print (std::string prefix="") override
 
double compute_prior () override
 Compute the prior – defaultly not defined. More...
 
virtual double compute_likelihood (const data_t &data, const double breakout=-infinity) override
 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 void print (std::string prefix="") override
 
virtual double compute_single_likelihood (const datum_t &datum) override
 Compute the likelihood of a single data point. More...
 
double compute_single_likelihood (const datum_t &x) override
 Compute the likelihood of a single data point. More...
 
void print (std::string prefix="#\) override
 
virtual std::pair< MyHypothesis, double > propose () const override
 This proposal guarantees that there will be at least one factor that is proposed to. Each individual factor is proposed to with p_factor_propose. More...
 
virtual D callOne (const D x, const D err)
 
double compute_single_likelihood (const datum_t &datum) override
 Compute the likelihood of a single data point. More...
 
size_t count_constants () const
 
virtual double compute_constants_prior () const
 
virtual double compute_prior () override
 Compute the prior – defaultly not defined. More...
 
virtual std::string __my_string_recurse (const Node *n, size_t &idx) const
 
virtual std::string string (std::string prefix="") const override
 
virtual std::string structure_string (bool usedot=true) const
 
virtual bool operator== (const MyHypothesis &h) const override
 
virtual size_t hash () const override
 
virtual std::pair< MyHypothesis, double > propose () const override
 
virtual void randomize_constants ()
 
virtual MyHypothesis restart () const override
 
virtual void complete () override
 Fill in all the holes in this hypothesis, at random, modifying self. NOTE for LOTHypotheses this will also compile, which is what we need to do for a LOTHypothesis. More...
 
virtual MyHypothesis make_neighbor (int k) const override
 Return a new hypothesis which is the k'th neighbor (just calls expand_to_neighbor) NOTE This does not compile since it might not be complete. More...
 
virtual void expand_to_neighbor (int k) override
 Modify this hypothesis to become the k'th neighbor. NOTE This does not compile since it might not be complete. More...
 
- Public Member Functions inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
 LOTHypothesis ()
 
 LOTHypothesis (Node &x)
 
 LOTHypothesis (Node &&x)
 
 LOTHypothesis (std::string s)
 
 LOTHypothesis (const LOTHypothesis &c)
 
 LOTHypothesis (const LOTHypothesis &&c)
 
LOTHypothesisoperator= (const LOTHypothesis &c)
 
LOTHypothesisoperator= (const LOTHypothesis &&c)
 
Nodeget_value ()
 
const Nodeget_value () const
 
void set_value (Node &v)
 Set the value to v. (NOTE: This compiles into a program) More...
 
void set_value (Node &&v)
 
Grammar_tget_grammar () const
 
void compile ()
 
virtual void push_program (Program< VirtualMachineState_t > &s) override
 This puts the code from my node onto s. Used internally in e.g. recursion. More...
 
virtual std::string string (std::string prefix, bool usedot) const
 
virtual output_t callOne (const input_t x, const output_t &err=output_t{})
 A variant of call that assumes no stochasticity and therefore outputs only a single value. (This uses a nullptr virtual machine pool, so will throw an error on flip) More...
 
virtual DiscreteDistribution< output_tcall (const input_t x, const output_t &err=output_t{})
 Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls. More...
 
virtual int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
virtual bool is_evaluable () const override
 A node is "evaluable" if it is complete (meaning no null subnodes) More...
 
size_t recursion_count ()
 Count up how many times I use recursion – we keep a list of recursion here. More...
 
virtual std::string serialize () const override
 Convert this into a string which can be written to a file. More...
 
- Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< D, D >, std::vector< defaultdatum_t< D, D > > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from Bayesable< Args... >
 Bayesable ()
 
virtual void clear_bayes ()
 
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
 
virtual bool operator< (const Bayesable< datum_t, data_t > &l) const
 
- Public Member Functions inherited from ProgramLoader< typename MyGrammar ::VirtualMachineState_t >
virtual void push_program (Program< typename MyGrammar ::VirtualMachineState_t > &s, const short a)
 
virtual void push_program (Program< typename MyGrammar ::VirtualMachineState_t > &s, const int a)
 
virtual void push_program (Program< typename MyGrammar ::VirtualMachineState_t > &s, const std::string k)
 
- Public Member Functions inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
 LOTHypothesis ()
 
 LOTHypothesis (Node &x)
 
 LOTHypothesis (Node &&x)
 
 LOTHypothesis (std::string s)
 
 LOTHypothesis (const LOTHypothesis &c)
 
 LOTHypothesis (const LOTHypothesis &&c)
 
LOTHypothesisoperator= (const LOTHypothesis &c)
 
LOTHypothesisoperator= (const LOTHypothesis &&c)
 
Nodeget_value ()
 
const Nodeget_value () const
 
void set_value (Node &v)
 Set the value to v. (NOTE: This compiles into a program) More...
 
void set_value (Node &&v)
 
Grammar_tget_grammar () const
 
void compile ()
 
virtual void push_program (Program< VirtualMachineState_t > &s) override
 This puts the code from my node onto s. Used internally in e.g. recursion. More...
 
virtual std::string string (std::string prefix, bool usedot) const
 
virtual output_t callOne (const input_t x, const output_t &err=output_t{})
 A variant of call that assumes no stochasticity and therefore outputs only a single value. (This uses a nullptr virtual machine pool, so will throw an error on flip) More...
 
virtual int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
virtual bool is_evaluable () const override
 A node is "evaluable" if it is complete (meaning no null subnodes) More...
 
size_t recursion_count ()
 Count up how many times I use recursion – we keep a list of recursion here. More...
 
virtual std::string serialize () const override
 Convert this into a string which can be written to a file. More...
 
- Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
 LOTHypothesis ()
 
 LOTHypothesis (Node &x)
 
 LOTHypothesis (Node &&x)
 
 LOTHypothesis (std::string s)
 
 LOTHypothesis (const LOTHypothesis &c)
 
 LOTHypothesis (const LOTHypothesis &&c)
 
LOTHypothesisoperator= (const LOTHypothesis &c)
 
LOTHypothesisoperator= (const LOTHypothesis &&c)
 
Nodeget_value ()
 
const Nodeget_value () const
 
void set_value (Node &v)
 Set the value to v. (NOTE: This compiles into a program) More...
 
void set_value (Node &&v)
 
Grammar_tget_grammar () const
 
void compile ()
 
virtual void push_program (Program< VirtualMachineState_t > &s) override
 This puts the code from my node onto s. Used internally in e.g. recursion. More...
 
virtual std::string string (std::string prefix, bool usedot) const
 
virtual output_t callOne (const input_t x, const output_t &err=output_t{})
 A variant of call that assumes no stochasticity and therefore outputs only a single value. (This uses a nullptr virtual machine pool, so will throw an error on flip) More...
 
virtual DiscreteDistribution< output_tcall (const input_t x, const output_t &err=output_t{})
 Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls. More...
 
virtual int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
virtual bool is_evaluable () const override
 A node is "evaluable" if it is complete (meaning no null subnodes) More...
 
size_t recursion_count ()
 Count up how many times I use recursion – we keep a list of recursion here. More...
 
virtual std::string serialize () const override
 Convert this into a string which can be written to a file. More...
 
- Public Member Functions inherited from MCMCable< MyHypothesis, std::multiset< int >, std::vector< std::multiset< int > > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
 LOTHypothesis ()
 
 LOTHypothesis (Node &x)
 
 LOTHypothesis (Node &&x)
 
 LOTHypothesis (std::string s)
 
 LOTHypothesis (const LOTHypothesis &c)
 
 LOTHypothesis (const LOTHypothesis &&c)
 
LOTHypothesisoperator= (const LOTHypothesis &c)
 
LOTHypothesisoperator= (const LOTHypothesis &&c)
 
Nodeget_value ()
 
const Nodeget_value () const
 
void set_value (Node &v)
 Set the value to v. (NOTE: This compiles into a program) More...
 
void set_value (Node &&v)
 
Grammar_tget_grammar () const
 
void compile ()
 
virtual void push_program (Program< VirtualMachineState_t > &s) override
 This puts the code from my node onto s. Used internally in e.g. recursion. More...
 
virtual std::string string (std::string prefix, bool usedot) const
 
virtual output_t callOne (const input_t x, const output_t &err=output_t{})
 A variant of call that assumes no stochasticity and therefore outputs only a single value. (This uses a nullptr virtual machine pool, so will throw an error on flip) More...
 
virtual DiscreteDistribution< output_tcall (const input_t x, const output_t &err=output_t{})
 Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls. More...
 
virtual int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
virtual bool is_evaluable () const override
 A node is "evaluable" if it is complete (meaning no null subnodes) More...
 
size_t recursion_count ()
 Count up how many times I use recursion – we keep a list of recursion here. More...
 
virtual std::string serialize () const override
 Convert this into a string which can be written to a file. More...
 
- Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
 LOTHypothesis ()
 
 LOTHypothesis (Node &x)
 
 LOTHypothesis (Node &&x)
 
 LOTHypothesis (std::string s)
 
 LOTHypothesis (const LOTHypothesis &c)
 
 LOTHypothesis (const LOTHypothesis &&c)
 
LOTHypothesisoperator= (const LOTHypothesis &c)
 
LOTHypothesisoperator= (const LOTHypothesis &&c)
 
Nodeget_value ()
 
const Nodeget_value () const
 
void set_value (Node &v)
 Set the value to v. (NOTE: This compiles into a program) More...
 
void set_value (Node &&v)
 
Grammar_tget_grammar () const
 
void compile ()
 
virtual void push_program (Program< VirtualMachineState_t > &s) override
 This puts the code from my node onto s. Used internally in e.g. recursion. More...
 
virtual std::string string (std::string prefix, bool usedot) const
 
virtual output_t callOne (const input_t x, const output_t &err=output_t{})
 A variant of call that assumes no stochasticity and therefore outputs only a single value. (This uses a nullptr virtual machine pool, so will throw an error on flip) More...
 
virtual DiscreteDistribution< output_tcall (const input_t x, const output_t &err=output_t{})
 Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls. More...
 
virtual int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
virtual bool is_evaluable () const override
 A node is "evaluable" if it is complete (meaning no null subnodes) More...
 
size_t recursion_count ()
 Count up how many times I use recursion – we keep a list of recursion here. More...
 
virtual std::string serialize () const override
 Convert this into a string which can be written to a file. More...
 
- Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
 Lexicon ()
 
size_t nfactors () const
 Return the number of factors. More...
 
auto & get_value ()
 
const auto & get_value () const
 
InnerHypothesisat (const int &k)
 
const InnerHypothesisat (const int &k) const
 
InnerHypothesisoperator[] (const int &k)
 
const InnerHypothesisoperator[] (const int &k) const
 
Grammar_tget_grammar ()
 
virtual void push_program (Program< VirtualMachineState_t > &s, const int k) override
 A lexicon has valid indices if calls to op_RECURSE, op_MEM_RECURSE, op_SAFE_RECURSE, and op_SAFE_MEM_RECURSE all have arguments that are less than the size. (So this places no restrictions on the calling earlier factors) More...
 
int neighbors () const override
 Count the number of neighbors that are possible. (This should be size_t but int is more convenient.) More...
 
void expand_to_neighbor (int k) override
 Modify this hypothesis to become the k'th neighbor. NOTE This does not compile since it might not be complete. More...
 
virtual double neighbor_prior (int k) override
 What is the prior of the k'th neighbor? This does not need to return the full prior, only relative (among ks) More...
 
bool is_evaluable () const override
 Check if we can evaluate this node (meaning compute a prior and posterior). NOTE that this is not the same as whether it has zero neighbors, since lexica might have neighbors but be evalable. More...
 
virtual DiscreteDistribution< output_tcall (const int k, const input_t x, const output_t &err=output_t{})
 
virtual std::string serialize () const override
 
- Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< S, S > >
 MCMCable ()
 
virtual bool operator!= (const MyHypothesis &h) const
 
- Public Member Functions inherited from ProgramLoader< typename InnerHypothesis ::Grammar_t::VirtualMachineState_t >
virtual void push_program (Program< typename InnerHypothesis ::Grammar_t::VirtualMachineState_t > &s)
 
virtual void push_program (Program< typename InnerHypothesis ::Grammar_t::VirtualMachineState_t > &s, const short a)
 
virtual void push_program (Program< typename InnerHypothesis ::Grammar_t::VirtualMachineState_t > &s, const std::string k)
 

Static Public Member Functions

static MyHypothesis sample ()
 
- Static Public Member Functions inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
static MyHypothesis sample ()
 
static MyHypothesis from_string (Grammar_t *g, std::string s)
 
static MyHypothesis deserialize (const std::string &s)
 Convert this from a string which was in a file. More...
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< D, D >, std::vector< defaultdatum_t< D, D > > >
static MyHypothesis 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...
 
- Static Public Member Functions inherited from Serializable< MyHypothesis >
static MyHypothesis deserialize (const std::string &)
 
- Static Public Member Functions inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
static MyHypothesis sample ()
 
static MyHypothesis from_string (Grammar_t *g, std::string s)
 
static MyHypothesis deserialize (const std::string &s)
 Convert this from a string which was in a file. More...
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< S, S >, std::vector< defaultdatum_t< S, S > > >
static MyHypothesis 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...
 
- Static Public Member Functions inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
static MyHypothesis sample ()
 
static MyHypothesis from_string (Grammar_t *g, std::string s)
 
static MyHypothesis deserialize (const std::string &s)
 Convert this from a string which was in a file. More...
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, std::multiset< int >, std::vector< std::multiset< int > > >
static MyHypothesis 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...
 
- Static Public Member Functions inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
static MyHypothesis sample ()
 
static MyHypothesis from_string (Grammar_t *g, std::string s)
 
static MyHypothesis deserialize (const std::string &s)
 Convert this from a string which was in a file. More...
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< set, word >, std::vector< defaultdatum_t< set, word > > >
static MyHypothesis 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...
 
- Static Public Member Functions inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
static MyHypothesis sample ()
 
static MyHypothesis from_string (Grammar_t *g, std::string s)
 
static MyHypothesis deserialize (const std::string &s)
 Convert this from a string which was in a file. More...
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< utterance, word >, std::vector< defaultdatum_t< utterance, word > > >
static MyHypothesis 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...
 
- Static Public Member Functions inherited from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
static MyHypothesis sample (std::initializer_list< int > lst)
 Sample with n factors. More...
 
static MyHypothesis make (A... a)
 
static MyHypothesis deserialize (const std::string s)
 
- Static Public Member Functions inherited from MCMCable< MyHypothesis, defaultdatum_t< S, S > >
static MyHypothesis 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 Attributes inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
unsigned long total_instruction_count_last_call
 
unsigned long total_vms_steps
 
Program< VirtualMachineState_tprogram
 
- Public Attributes inherited from Bayesable< Args... >
double prior
 
double likelihood
 
double posterior
 
uintmax_t born
 
size_t born_chain_idx
 
- Public Attributes inherited from ProgramLoader< typename MyGrammar ::VirtualMachineState_t >
bool was_called
 
- Public Attributes inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
unsigned long total_instruction_count_last_call
 
unsigned long total_vms_steps
 
Program< VirtualMachineState_tprogram
 
- Public Attributes inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
unsigned long total_instruction_count_last_call
 
unsigned long total_vms_steps
 
Program< VirtualMachineState_tprogram
 
- Public Attributes inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
unsigned long total_instruction_count_last_call
 
unsigned long total_vms_steps
 
Program< VirtualMachineState_tprogram
 
- Public Attributes inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
unsigned long total_instruction_count_last_call
 
unsigned long total_vms_steps
 
Program< VirtualMachineState_tprogram
 
- Public Attributes inherited from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
std::map< int, InnerHypothesisfactors
 
- Public Attributes inherited from ProgramLoader< typename InnerHypothesis ::Grammar_t::VirtualMachineState_t >
bool was_called
 
- Static Public Attributes inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
static const char SerializationDelimiter
 
static const size_t MAX_NODES
 
- Static Public Attributes inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
static const char SerializationDelimiter
 
static const size_t MAX_NODES
 
- Static Public Attributes inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
static const char SerializationDelimiter
 
static const size_t MAX_NODES
 
- Static Public Attributes inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
static const char SerializationDelimiter
 
static const size_t MAX_NODES
 
- Static Public Attributes inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
static const char SerializationDelimiter
 
static const size_t MAX_NODES
 
- Static Public Attributes inherited from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >
static const char FactorDelimiter
 
static double p_factor_propose
 
- Protected Attributes inherited from LOTHypothesis< MyHypothesis, D, D, MyGrammar,&grammar >
Node value
 
- Protected Attributes inherited from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >
Node value
 
- Protected Attributes inherited from LOTHypothesis< MyHypothesis, int, NumberSet, MyGrammar,&grammar, std::multiset< int > >
Node value
 
- Protected Attributes inherited from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >
Node value
 
- Protected Attributes inherited from LOTHypothesis< MyHypothesis, utterance, word, MyGrammar,&grammar >
Node value
 

Detailed Description

Declare a grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
class MyGrammar : public Grammar<utterance,word, bool,word,set,objectkind,utterance,wmset,magnitude,double>,
public Singleton<MyGrammar> {
public:
add("undef", +[]() -> word { return U; });
add("a", +[]() -> objectkind { return 'a'; });
add("b", +[]() -> objectkind { return 'b'; });
add("c", +[]() -> objectkind { return 'c'; });
add("d", +[]() -> objectkind { return 'd'; });
add("e", +[]() -> objectkind { return 'e'; });
add("one", +[]() -> word { return 1; }, 0.1);
add("two", +[]() -> word { return 2; }, 0.1);
add("three", +[]() -> word { return 3; }, 0.1);
add("four", +[]() -> word { return 4; }, 0.1);
add("five", +[]() -> word { return 5; }, 0.1);
add("six", +[]() -> word { return 6; }, 0.1);
add("seven", +[]() -> word { return 7; }, 0.1);
add("eight", +[]() -> word { return 8; }, 0.1);
add("nine", +[]() -> word { return 9; }, 0.1);
add("ten", +[]() -> word { return 10; }, 0.1);
add("next(%s)", +[](word w) -> word { return w == U ? U : w+1;});
add("prev(%s)", +[](word w) -> word { return w == U or w == 1 ? U : w-1; });
// extract from the context/utterance
add("%s.set", +[](utterance u) -> set { return u.s; }, 25.0);
add("%s.obj", +[](utterance u) -> objectkind { return u.o; }, 10.0);
// build utterances -- needed for useful recursion
add("<%s,%s>", +[](set s, objectkind o) -> utterance { return utterance{s,o}; });
add("union(%s,%s)", +[](set x, set y) -> set {
if(x.size()+y.size() > MAX_SET_SIZE)
throw VMSRuntimeError();
return x+y;
});
add("intersection(%s,%s)", +[](set x, set y) -> set {
std::string out = "";
for(size_t yi=0;yi<y.length();yi++) {
std::string s = y.substr(yi,1);
size_t pos = x.find(s); // do I occur?
if(pos != std::string::npos) {
out.append(s);
}
}
return out;
});
add("difference(%s,%s)", +[](set x, set y) -> set {
std::string out = x;
for(size_t yi=0;yi<y.length();yi++) {
std::string s = y.substr(yi,1);
size_t pos = out.find(s); // do I occur?
if(pos != std::string::npos) {
out.erase(pos,1); // remove that character
}
}
return out;
});
add("filter(%s,%s)", +[](set x, objectkind t) -> set {
std::string tstr = std::string(1,t); // a std::string to find
std::string out = "";
size_t pos = x.find(tstr);
while (pos != std::string::npos) {
out = out + tstr;
pos = x.find(tstr,pos+1);
}
return out;
});
add("select(%s)", +[](set x) -> set {
return x.substr(0,1);
});
add("selectO(%s,%s)", +[](set x, objectkind o) -> set {
if(x.find(o) != std::string::npos){
return std::string(1,o); // must exist there
}
else {
return set("");
}
});
add("match(%s,%s)", +[](wmset x, set s) -> bool { return x == (wmset)s.size(); }, 1.0);
add("{}", +[]() -> wmset { return (wmset)0; });
add("{o}", +[]() -> wmset { return (wmset)1; });
add("{o,o}", +[]() -> wmset { return (wmset)2; });
add("{o,o,o}", +[]() -> wmset { return (wmset)3; });
// ANS operations
add("ANSeq(%s,%s)", +[](set a, set b) -> double { return ANSzero(a.length(), b.length()); }, 1.0/3.0);
add("ANSeq(%s,%s)", +[](set a, wmset b) -> double { return ANSzero(a.length(), b); }, 1.0/3.0);
add("ANSeq(%s,%s)", +[](set a, magnitude b) -> double { return ANSzero(a.length(), b); }, 1.0/3.0);
add("ANSlt(%s,%s)", +[](set a, set b) -> double { return 1.0-normcdf(ANSdiff(a.length(), b.length())); }, 1.0/5.0);
add("ANSlt(%s,%s)", +[](set a, wmset b) -> double { return 1.0-normcdf(ANSdiff(a.length(), b)); }, 1.0/5.0);
add("ANSlt(%s,%s)", +[](set a, magnitude b) -> double { return 1.0-normcdf(ANSdiff(a.length(), b)); }, 1.0/5.0);
add("ANSlt(%s,%s)", +[](wmset b, set a) -> double { return 1.0-normcdf(ANSdiff(b, a.length())); }, 1.0/5.0);
add("ANSlt(%s,%s)", +[](magnitude b, set a) -> double { return 1.0-normcdf(ANSdiff(b, a.length())); }, 1.0/5.0);
add("1", +[]() -> magnitude { return 1; });
add("2", +[]() -> magnitude { return 2; });
add("3", +[]() -> magnitude { return 3; });
add("4", +[]() -> magnitude { return 4; });
add("5", +[]() -> magnitude { return 5; });
add("6", +[]() -> magnitude { return 6; });
add("7", +[]() -> magnitude { return 7; });
add("8", +[]() -> magnitude { return 8; });
add("9", +[]() -> magnitude { return 9; });
add("10", +[]() -> magnitude { return 10; });
add("and(%s,%s)", Builtins::And<MyGrammar>, 1./3);
add("or(%s,%s)", Builtins::Or<MyGrammar>, 1./3);
add("not(%s)", Builtins::Not<MyGrammar>, 1./3);
add("x", Builtins::X<MyGrammar>, 10.);
add("flip()", Builtins::Flip<MyGrammar>, 2.0);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,set>, 1./5);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,word>, 1./5);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,wmset>, 1./5);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,objectkind>, 1./5);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,magnitude>, 1./5);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,utterance>, 1./5);
add("recurse(%s)", Builtins::Recurse<MyGrammar>);
}
/*

Declare our hypothesis type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Declare a grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
class MyGrammar : public Grammar<set, word, bool, word, set>,
public Singleton<MyGrammar> {
public:
add("undef", +[]() -> word { return U; });
add("one", +[]() -> word { return 1; }, 0.1);
add("two", +[]() -> word { return 2; }, 0.1);
add("three", +[]() -> word { return 3; }, 0.1);
add("four", +[]() -> word { return 4; }, 0.1);
add("five", +[]() -> word { return 5; }, 0.1);
add("six", +[]() -> word { return 6; }, 0.1);
add("seven", +[]() -> word { return 7; }, 0.1);
add("eight", +[]() -> word { return 8; }, 0.1);
add("nine", +[]() -> word { return 9; }, 0.1);
add("ten", +[]() -> word { return 10; }, 0.1);
add("next(%s)", +[](word w) -> word { return w == U ? U : w+1;});
add("prev(%s)", +[](word w) -> word { return w == U or w == 1 ? U : w-1; });
// extract from the context/utterance
add("singleton(%s)", +[](set s) -> bool { return s.count()==1; }, 2.0);
add("doubleton(%s)", +[](set s) -> bool { return s.count()==2; }, 2.0);
add("tripleton(%s)", +[](set s) -> bool { return s.count()==3; }, 2.0);
add("select(%s)", +[](set s) -> set {
if(s.count()==0) {
throw VMSRuntimeError();
}
else {
for(size_t i=0;i<s.size();i++) {
if(s[i]) { // return the first element of th eset
set out;
out[i] = true;
return out;
}
}
assert(false && "*** Should not get here");
}
});
// set operations on ints -- these will modify x in place
add("union(%s,%s)", +[](set x, set y) -> set { return x |= y; });
add("setdifference(%s,%s)", +[](set x, set y) -> set { return x &= ~y; });
add("intersection(%s,%s)", +[](set x, set y) -> set { return x &= y; });
add("complement(%s,%s)", +[](set x, set y) -> set { return x = ~x; }); // not in the original
add("and(%s,%s)", Builtins::And<MyGrammar>, 1./3.);
add("or(%s,%s)", Builtins::Or<MyGrammar>, 1./3.);
add("not(%s)", Builtins::Not<MyGrammar>, 1./3.);
add("x", Builtins::X<MyGrammar>, 25.0);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,set>, 1./2);
add("if(%s,%s,%s)", Builtins::If<MyGrammar,word>, 1./2);
add("recurse(%s)", Builtins::Recurse<MyGrammar>);
}
/*

Declare our hypothesis type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define the grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
class MyGrammar : public Grammar<int, NumberSet, int, NumberSet>,
public Singleton<MyGrammar> {
public:
add("numbers", +[]() -> NumberSet { return numbers; });
add("primes", +[]() -> NumberSet { return primes; });
add("evens", +[]() -> NumberSet { return evens; });
add("odds", +[]() -> NumberSet { return odds; });
add("squares", +[]() -> NumberSet { return squares; });
add("decades", +[]() -> NumberSet { return decades; });
add("elevens", +[]() -> NumberSet { return elevens; });
add("fibonacci", +[]() -> NumberSet { return fibonacci; });
add("weird", +[]() -> NumberSet { return weird; });
// we give range a very low prior here or else it sure dominates
add("range(%s,%s)", +[](int x, int y) -> NumberSet {
NumberSet out;
for(int i=std::max(x,Nlow);i<=std::min(y,N);i++) { // we need min/max bounds here or we spend all our time adding garbage
out.insert(i);
}
return out;
}, 0.1);
add("union(%s,%s)", +[](NumberSet a, NumberSet b) -> NumberSet {
for(auto& x : b) {
a.insert(x);
}
return a;
});
add("intersection(%s,%s)", +[](NumberSet a, NumberSet b) -> NumberSet {
NumberSet out;
for(auto& x : a) {
if(b.find(x) != b.end())
out.insert(x);
}
return out;
});
add("complement(%s)", +[](NumberSet a) -> NumberSet {
NumberSet out;
for(size_t i=Nlow;i<N;i++) {
if(a.find(i) == a.end())
out.insert(i);
}
return out;
});
add("(%s + %s)", +[](NumberSet s, int n) -> NumberSet {
NumberSet out;
for(auto& x : s) {
out.insert(x + n);
}
return out;
});
add("(%s * %s)", +[](NumberSet s, int n) -> NumberSet {
NumberSet out;
for(auto& x : s) {
out.insert(x * n);
}
return out;
});
add("pow(%s,%s)", +[](NumberSet s, int n) -> NumberSet {
NumberSet out;
for(auto& x : s) {
out.insert(std::pow(x,n));
}
return out;
});
// we'll give this a space so it's different -- cute
add("pow(%s, %s)", +[](int n, NumberSet s) -> NumberSet {
NumberSet out;
for(auto& x : s) {
out.insert(std::pow(n,x));
}
return out;
});
// int operations
add("(%s+%s)", +[](int x, int y) -> int { return x+y;});
add("(%s*%s)", +[](int x, int y) -> int { return x*y;});
add("(%s-%s)", +[](int x, int y) -> int { return x-y;});
add("(%s^%s)", +[](int x, int y) -> int { return std::pow(x,y);});
for(int i=Nlow;i<=N;i++) {
// We put "#" here so that in grammar inference we can find these rules easily!
add_terminal( "#"+str(i), i, 10.0/(N-Nlow));
}
add("x", Builtins::X<MyGrammar>);
}
/*

Define hypothesis This is an example where our data is different – it's a set instead of a vector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
// We need these to declare this so it is defined before grammar,
// and so these can be accessed in grammar.
// What a goddamn nightmare (the other option is to separate header files)
struct ConstantContainer {
std::vector<D> constants;
size_t constant_idx; // in evaluation, this variable stores what constant we are in
};
class MyGrammar : public Grammar<D,D, D>,
public Singleton<MyGrammar> {
public:
add("(%s+%s)", +[](D a, D b) -> D { return a+b; }),
add("(%s-%s)", +[](D a, D b) -> D { return a-b; }),
add("(%s*%s)", +[](D a, D b) -> D { return a*b; }),
add("(%s/%s)", +[](D a, D b) -> D { return (b==0 ? 0 : a/b); }),
add("pow(%s,%s)", +[](D a, D b) -> D { return pow(a,b); }),
add("(-%s)", +[](D a) -> D { return -a; }),
add("exp(%s)", +[](D a) -> D { return exp(a); }),
add("log(%s)", +[](D a) -> D { return log(a); }),
add("1", +[]() -> D { return 1.0; }),
// give the type to add and then a vms function
add_vms<D>("C", new std::function(+[](MyGrammar::VirtualMachineState_t* vms, int) {
// Here we are going to use a little hack -- we actually know that vms->program_loader
// is of type MyHypothesis, so we will cast to that
auto* h = dynamic_cast<ConstantContainer*>(vms->program.loader);
if(h == nullptr) { assert(false); }
else {
assert(h->constant_idx < h->constants.size());
vms->template push<D>(h->constants.at(h->constant_idx++));
}
}), 5.0);
add("x", Builtins::X<MyGrammar>, 5.0);
}
// check if a rule is constant
bool isConstant(const Rule* r) { return r->format == "C"; }
/*

Define hypothesis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Member Typedef Documentation

◆ Super [1/6]

◆ Super [2/6]

◆ Super [3/6]

◆ Super [4/6]

using MyHypothesis::Super = LOTHypothesis<MyHypothesis,int,NumberSet,MyGrammar,&grammar,std::multiset<int> >

◆ Super [5/6]

◆ Super [6/6]

Member Function Documentation

◆ __my_string_recurse()

virtual std::string MyHypothesis::__my_string_recurse ( const Node n,
size_t &  idx 
) const
inlinevirtual

recurse on the children. NOTE: they are linearized left->right,

◆ call() [1/2]

DiscreteDistribution<word> MyHypothesis::call ( const utterance &  input)
inline

◆ call() [2/2]

virtual DiscreteDistribution<S> MyHypothesis::call ( const S  x,
const S err = S{} 
)
inlinevirtual

Run the virtual machine on input x, and marginalize over execution paths to return a distribution on outputs. Note that loader must be a program loader, and that is to handle recursion and other function calls.

Parameters
x- input
err- output value on error
loader- where to load recursive calls
Returns

Reimplemented from LOTHypothesis< MyHypothesis, S, S, MyGrammar,&grammar >.

◆ callOne()

virtual D MyHypothesis::callOne ( const D  x,
const D  err 
)
inlinevirtual

◆ complete()

virtual void MyHypothesis::complete ( )
inlineoverridevirtual

Fill in all the holes in this hypothesis, at random, modifying self. NOTE for LOTHypotheses this will also compile, which is what we need to do for a LOTHypothesis.

Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ compute_constants_prior()

virtual double MyHypothesis::compute_constants_prior ( ) const
inlinevirtual

◆ compute_likelihood() [1/2]

virtual double MyHypothesis::compute_likelihood ( const data_t data,
const double  breakout = -infinity 
)
inlineoverridevirtual

Compute the likelihood of a collection of data, by calling compute_single_likelihood on each. This stops if our likelihood falls below breakout.

Parameters
data
breakout
Returns

Reimplemented from Bayesable< Args... >.

◆ compute_likelihood() [2/2]

double MyHypothesis::compute_likelihood ( const data_t data,
const double  breakout = -infinity 
)
inlineoverridevirtual

Compute the likelihood of a collection of data, by calling compute_single_likelihood on each. This stops if our likelihood falls below breakout.

Parameters
data
breakout
Returns

Reimplemented from Bayesable< Args... >.

◆ compute_prior() [1/3]

double MyHypothesis::compute_prior ( )
inlineoverridevirtual

Compute the prior – defaultly not defined.

Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ compute_prior() [2/3]

virtual double MyHypothesis::compute_prior ( )
inlineoverridevirtual

Compute the prior – defaultly not defined.

Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ compute_prior() [3/3]

double MyHypothesis::compute_prior ( )
inlineoverridevirtual

Compute the prior – defaultly not defined.

Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ compute_single_likelihood() [1/5]

double MyHypothesis::compute_single_likelihood ( const datum_t datum)
inlineoverridevirtual

Compute the likelihood of a single data point.

Parameters
datum

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ compute_single_likelihood() [2/5]

double MyHypothesis::compute_single_likelihood ( const datum_t datum)
inlineoverridevirtual

Compute the likelihood of a single data point.

Parameters
datum

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ compute_single_likelihood() [3/5]

virtual double MyHypothesis::compute_single_likelihood ( const datum_t datum)
inlineoverridevirtual

Compute the likelihood of a single data point.

Parameters
datum

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ compute_single_likelihood() [4/5]

double MyHypothesis::compute_single_likelihood ( const datum_t datum)
inlineoverridevirtual

Compute the likelihood of a single data point.

Parameters
datum

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ compute_single_likelihood() [5/5]

virtual double MyHypothesis::compute_single_likelihood ( const datum_t datum)
inlineoverridevirtual

Compute the likelihood of a single data point.

Parameters
datum

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ count_constants()

size_t MyHypothesis::count_constants ( ) const
inline

◆ expand_to_neighbor()

virtual void MyHypothesis::expand_to_neighbor ( int  k)
inlineoverridevirtual

Modify this hypothesis to become the k'th neighbor. NOTE This does not compile since it might not be complete.

Parameters
k

Reimplemented from LOTHypothesis< MyHypothesis, set, word, MyGrammar,&grammar >.

◆ hash()

virtual size_t MyHypothesis::hash ( ) const
inlineoverridevirtual

◆ make_neighbor()

virtual MyHypothesis MyHypothesis::make_neighbor ( int  k) const
inlineoverridevirtual

Return a new hypothesis which is the k'th neighbor (just calls expand_to_neighbor) NOTE This does not compile since it might not be complete.

Parameters
k
Returns

Reimplemented from Searchable< MyHypothesis, S, S >.

◆ operator==()

virtual bool MyHypothesis::operator== ( const MyHypothesis h) const
inlineoverridevirtual

Change equality to include equality of constants


Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ print() [1/4]

virtual void MyHypothesis::print ( std::string  prefix = "")
inlineoverridevirtual

Reimplemented from Bayesable< Args... >.

◆ print() [2/4]

void MyHypothesis::print ( std::string  prefix = "#\n")
inlineoverridevirtual

Reimplemented from Bayesable< Args... >.

◆ print() [3/4]

virtual void MyHypothesis::print ( std::string  prefix = "")
inlineoverridevirtual

Reimplemented from Bayesable< Args... >.

◆ print() [4/4]

void MyHypothesis::print ( std::string  prefix = "")
inlineoverridevirtual

Reimplemented from Bayesable< Args... >.

◆ propose() [1/2]

virtual std::pair<MyHypothesis,double> MyHypothesis::propose ( ) const
inlineoverridevirtual

This proposal guarantees that there will be at least one factor that is proposed to. Each individual factor is proposed to with p_factor_propose.

Returns

Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ propose() [2/2]

virtual std::pair<MyHypothesis,double> MyHypothesis::propose ( ) const
inlineoverridevirtual

Implement MCMC moves as changes to constants


Reimplemented from Lexicon< MyHypothesis, int, InnerHypothesis, S, S >.

◆ randomize_constants()

virtual void MyHypothesis::randomize_constants ( )
inlinevirtual

◆ restart()

virtual MyHypothesis MyHypothesis::restart ( ) const
inlineoverridevirtual

◆ sample()

static MyHypothesis MyHypothesis::sample ( )
inlinestatic

◆ string()

virtual std::string MyHypothesis::string ( std::string  prefix = "") const
inlineoverridevirtual

◆ structure_string()

virtual std::string MyHypothesis::structure_string ( bool  usedot = true) const
inlinevirtual

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