Fleet  0.0.9
Inference in the LOT
Public Types | Public Member Functions | Static Public Member Functions | List of all members
MyGrammarHypothesis Class Referencefinal

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ More...

#include <MyGrammarHypothesis.h>

Inheritance diagram for MyGrammarHypothesis:
Inheritance graph
[legend]
Collaboration diagram for MyGrammarHypothesis:
Collaboration graph
[legend]

Public Types

using Super = ThunkGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > >>
 
using data_t = Super::data_t
 
using Super = DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum >
 
using data_t = Super::data_t
 
using Super = DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis >
 
using Super = BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >
 
using Super = BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >
 
using Super = BaseGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >
 
- Public Types inherited from DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis >
using HYP = MyHypothesis
 
using Super = BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
 
using LL_t = Super::LL_t
 
using Predict_t = Super::Predict_t
 
- Public Types inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
using HYP = MyHypothesis
 
using Predict_t = Vector2D< typename MyHypothesis ::output_t >
 
using LL_t = std::unordered_map< typename HumanDatum< MyHypothesis > ::std::vector< HumanDatum< MyHypothesis > > *, std::vector< Vector > >
 
- Public Types inherited from Bayesable< Args... >
typedef Args... datum_t
 
typedef std::vector< Args... > data_t
 
- Public Types inherited from DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum >
using HYP = MyHypothesis
 
using Super = BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
 
using LL_t = Super::LL_t
 
using Predict_t = Super::Predict_t
 
- Public Types inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
using HYP = MyHypothesis
 
using Predict_t = Vector2D< typename MyHypothesis ::output_t >
 
using LL_t = std::unordered_map< typename MyHumanDatum ::std::vector< MyHumanDatum > *, std::vector< Vector > >
 
- Public Types inherited from ThunkGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
using HYP = MyHypothesis
 
using Super = BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
 
using LL_t = Super::LL_t
 
using Predict_t = Super::Predict_t
 
- Public Types inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
using HYP = MyHypothesis
 
using Predict_t = Vector2D< DiscreteDistribution< S > >
 
using LL_t = std::unordered_map< typename MyHumanDatum ::std::vector< MyHumanDatum > *, std::vector< Vector > >
 

Public Member Functions

virtual double human_chance_lp (const typename datum_t::output_t &r, const datum_t &hd) const override
 
virtual void recompute_LL (std::vector< HYP > &hypotheses, const data_t &human_data) override
 
virtual std::map< typename HYP::output_t, double > compute_model_predictions (const data_t &human_data, const size_t i, const Matrix &hposterior) const override
 
virtual double compute_likelihood (const data_t &human_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...
 
 MyGrammarHypothesis (std::vector< HYP > &hypotheses, const data_t *human_data)
 
- Public Member Functions inherited from DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis >
 DeterministicGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > *human_data)
 
virtual void recompute_P (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data) override
 Recompute the predictions for the hypotheses and data. More...
 
virtual std::map< typename HYP::output_t, double > compute_model_predictions (const std::vector< HumanDatum< MyHypothesis > > &human_data, const size_t i, const Matrix &hposterior) const override
 This uses hposterior (computed via this->compute_normalized_posterior()) to compute the model predictions on a the i'th human data point. To do this, we marginalize over hypotheses, computing the weighted sum of outputs. More...
 
- Public Member Functions inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
 BaseGrammarHypothesis ()
 
 BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > *human_data)
 
void set_decay (const ExponentialVariable &ev)
 
void set_decay_untransformed (double v)
 
void set_alpha (const UniformVariable &a)
 
void set_alpha_untransformed (double v)
 
void copy_parameters (const BaseGrammarHypothesis &h)
 
float get_alpha () const
 
float get_decay () const
 
size_t ndata () const
 
virtual void set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data)
 This is the primary function for setting hypothese and data on construction. More...
 
virtual void set_can_propose (size_t i, bool b)
 Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
 
void set_flat_prior (bool fp)
 
virtual size_t nhypotheses () const
 A convenient function that uses C to say how many hypotheses. More...
 
virtual void recompute_C (const std::vector< HYP > &hypotheses)
 Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
 
virtual void recompute_LL (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data)
 Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
 
virtual void recompute_decayedLikelihood (const std::vector< HumanDatum< MyHypothesis > > &human_data)
 Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
 
virtual const HYPcomputeMAP (const size_t di, const Matrix &hposterior) const
 
virtual double human_chance_lp (const typename HumanDatum< MyHypothesis > ::output_t &r, const HumanDatum< MyHypothesis > &hd) const
 Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
 
virtual double compute_prior () override
 
virtual Matrix compute_normalized_posterior () const
 This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
 
virtual double compute_likelihood (const std::vector< HumanDatum< MyHypothesis > > &human_data, const double breakout=-infinity) override
 This computes the likelihood of the human data. More...
 
virtual MyGrammarHypothesis restart () const override
 
virtual std::optional< std::pair< MyGrammarHypothesis, double > > propose () const override
 Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
 
virtual Vector hypothesis_prior () const
 Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
 
virtual bool operator== (const MyGrammarHypothesis &h) const override
 
virtual std::string string (std::string prefix="") const override
 This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
 
virtual void show (std::string prefix="") override
 Need to override print since it will print in a different format. More...
 
virtual size_t hash () const override
 
virtual std::string serialize () const override
 
- Public Member Functions inherited from MCMCable< MyGrammarHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > > >
 MCMCable ()
 
virtual bool operator!= (const MyGrammarHypothesis &h) const
 
- Public Member Functions inherited from Bayesable< Args... >
 Bayesable ()
 
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_tempered_likelihood (const data_t &data, int ladder_rank, const double breakout=-infinity)
 
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
 
- Public Member Functions inherited from DeterministicGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum >
 DeterministicGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
virtual void recompute_P (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override
 Recompute the predictions for the hypotheses and data. More...
 
virtual std::map< typename HYP::output_t, double > compute_model_predictions (const std::vector< MyHumanDatum > &human_data, const size_t i, const Matrix &hposterior) const override
 This uses hposterior (computed via this->compute_normalized_posterior()) to compute the model predictions on a the i'th human data point. To do this, we marginalize over hypotheses, computing the weighted sum of outputs. More...
 
- Public Member Functions inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
 BaseGrammarHypothesis ()
 
 BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
void set_decay (const ExponentialVariable &ev)
 
void set_decay_untransformed (double v)
 
void set_alpha (const UniformVariable &a)
 
void set_alpha_untransformed (double v)
 
void copy_parameters (const BaseGrammarHypothesis &h)
 
float get_alpha () const
 
float get_decay () const
 
size_t ndata () const
 
virtual void set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data)
 This is the primary function for setting hypothese and data on construction. More...
 
virtual void set_can_propose (size_t i, bool b)
 Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
 
void set_flat_prior (bool fp)
 
virtual size_t nhypotheses () const
 A convenient function that uses C to say how many hypotheses. More...
 
virtual void recompute_C (const std::vector< HYP > &hypotheses)
 Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
 
virtual void recompute_LL (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data)
 Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
 
virtual void recompute_decayedLikelihood (const std::vector< MyHumanDatum > &human_data)
 Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
 
virtual const HYPcomputeMAP (const size_t di, const Matrix &hposterior) const
 
virtual double human_chance_lp (const typename MyHumanDatum ::output_t &r, const MyHumanDatum &hd) const
 Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
 
virtual double compute_prior () override
 
virtual Matrix compute_normalized_posterior () const
 This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
 
virtual double compute_likelihood (const std::vector< MyHumanDatum > &human_data, const double breakout=-infinity) override
 This computes the likelihood of the human data. More...
 
virtual MyGrammarHypothesis restart () const override
 
virtual std::optional< std::pair< MyGrammarHypothesis, double > > propose () const override
 Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
 
virtual Vector hypothesis_prior () const
 Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
 
virtual bool operator== (const MyGrammarHypothesis &h) const override
 
virtual std::string string (std::string prefix="") const override
 This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
 
virtual void show (std::string prefix="") override
 Need to override print since it will print in a different format. More...
 
virtual size_t hash () const override
 
virtual std::string serialize () const override
 
- Public Member Functions inherited from MCMCable< MyGrammarHypothesis, MyHumanDatum, std::vector< MyHumanDatum > >
 MCMCable ()
 
virtual bool operator!= (const MyGrammarHypothesis &h) const
 
- Public Member Functions inherited from ThunkGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
 ThunkGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
virtual void recompute_LL (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override
 Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
 
virtual void recompute_P (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override
 For a thunk, the predictions don't depend on the data. More...
 
virtual std::map< typename HYP::output_t, double > compute_model_predictions (const std::vector< MyHumanDatum > &human_data, const size_t i, const Matrix &hposterior) const override
 In this variant, we need to always use P->at(h,0) since we only have one prediction stored for thunks. More...
 
- Public Member Functions inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
 BaseGrammarHypothesis ()
 
 BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
void set_decay (const ExponentialVariable &ev)
 
void set_decay_untransformed (double v)
 
void set_alpha (const UniformVariable &a)
 
void set_alpha_untransformed (double v)
 
void copy_parameters (const BaseGrammarHypothesis &h)
 
float get_alpha () const
 
float get_decay () const
 
size_t ndata () const
 
virtual void set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data)
 This is the primary function for setting hypothese and data on construction. More...
 
virtual void set_can_propose (size_t i, bool b)
 Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
 
void set_flat_prior (bool fp)
 
virtual size_t nhypotheses () const
 A convenient function that uses C to say how many hypotheses. More...
 
virtual void recompute_C (const std::vector< HYP > &hypotheses)
 Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
 
virtual void recompute_decayedLikelihood (const std::vector< MyHumanDatum > &human_data)
 Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
 
virtual const HYPcomputeMAP (const size_t di, const Matrix &hposterior) const
 
virtual double human_chance_lp (const typename MyHumanDatum ::output_t &r, const MyHumanDatum &hd) const
 Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
 
virtual double compute_prior () override
 
virtual Matrix compute_normalized_posterior () const
 This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
 
virtual double compute_likelihood (const std::vector< MyHumanDatum > &human_data, const double breakout=-infinity) override
 This computes the likelihood of the human data. More...
 
virtual MyGrammarHypothesis restart () const override
 
virtual std::optional< std::pair< MyGrammarHypothesis, double > > propose () const override
 Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
 
virtual Vector hypothesis_prior () const
 Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
 
virtual bool operator== (const MyGrammarHypothesis &h) const override
 
virtual std::string string (std::string prefix="") const override
 This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
 
virtual void show (std::string prefix="") override
 Need to override print since it will print in a different format. More...
 
virtual size_t hash () const override
 
virtual std::string serialize () const override
 

Static Public Member Functions

static void remove_strings_and_renormalize (DiscreteDistribution< S > &M, datum_t::data_t *dptr, const size_t n)
 
- Static Public Member Functions inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
static MyGrammarHypothesis sample (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > *human_data)
 
static MyGrammarHypothesis deserialize (const std::string &s)
 
- Static Public Member Functions inherited from MCMCable< MyGrammarHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > > >
static MyGrammarHypothesis 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< MyGrammarHypothesis >
static MyGrammarHypothesis deserialize (const std::string &)
 
- Static Public Member Functions inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
static MyGrammarHypothesis sample (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
static MyGrammarHypothesis deserialize (const std::string &s)
 
- Static Public Member Functions inherited from MCMCable< MyGrammarHypothesis, MyHumanDatum, std::vector< MyHumanDatum > >
static MyGrammarHypothesis 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 BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
static MyGrammarHypothesis sample (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data)
 
static MyGrammarHypothesis deserialize (const std::string &s)
 

Additional Inherited Members

- Public Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
HYP::Grammar_tgrammar
 
bool flat_prior
 
VectorHalfNormalHypothesis logA
 
std::shared_ptr< MatrixC
 
std::shared_ptr< LL_tLL
 
std::shared_ptr< Predict_tP
 
std::shared_ptr< MatrixdecayedLikelihood
 
const std::vector< HumanDatum< MyHypothesis > > * which_data
 
std::vector< HYP > * which_hypotheses
 
- Public Attributes inherited from Bayesable< Args... >
double prior
 
double likelihood
 
double posterior
 
uintmax_t born
 
size_t born_chain_idx
 
- Public Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
HYP::Grammar_tgrammar
 
bool flat_prior
 
VectorHalfNormalHypothesis logA
 
std::shared_ptr< MatrixC
 
std::shared_ptr< LL_tLL
 
std::shared_ptr< Predict_tP
 
std::shared_ptr< MatrixdecayedLikelihood
 
const std::vector< MyHumanDatum > * which_data
 
std::vector< HYP > * which_hypotheses
 
- Public Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
HYP::Grammar_t * grammar
 
bool flat_prior
 
VectorHalfNormalHypothesis logA
 
std::shared_ptr< MatrixC
 
std::shared_ptr< LL_tLL
 
std::shared_ptr< Predict_tP
 
std::shared_ptr< MatrixdecayedLikelihood
 
const std::vector< MyHumanDatum > * which_data
 
std::vector< HYP > * which_hypotheses
 
- Protected Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, HumanDatum< MyHypothesis >, std::vector< HumanDatum< MyHypothesis > >, Vector2D< typename MyHypothesis ::output_t > >
UniformVariable alpha
 
ExponentialVariable decay
 
- Protected Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< typename MyHypothesis ::output_t > >
UniformVariable alpha
 
ExponentialVariable decay
 
- Protected Attributes inherited from BaseGrammarHypothesis< MyGrammarHypothesis, MyHypothesis, MyHumanDatum, std::vector< MyHumanDatum >, Vector2D< DiscreteDistribution< S > > >
UniformVariable alpha
 
ExponentialVariable decay
 

Detailed Description

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Member Typedef Documentation

◆ data_t [1/2]

◆ data_t [2/2]

◆ Super [1/6]

◆ Super [2/6]

using ThunkGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >::Super = BaseGrammarHypothesis<this_t, _HYP, datum_t, data_t, _Predict_t>

◆ Super [3/6]

◆ Super [4/6]

using ThunkGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >::Super = BaseGrammarHypothesis<this_t, _HYP, datum_t, data_t, _Predict_t>

◆ Super [5/6]

◆ Super [6/6]

using ThunkGrammarHypothesis< this_t, _HYP, datum_t, data_t, _Predict_t >::Super = BaseGrammarHypothesis<this_t, _HYP, datum_t, data_t, _Predict_t>

Constructor & Destructor Documentation

◆ MyGrammarHypothesis()

MyGrammarHypothesis::MyGrammarHypothesis ( std::vector< HYP > &  hypotheses,
const data_t human_data 
)
inline

Member Function Documentation

◆ compute_likelihood()

virtual double MyGrammarHypothesis::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

and the likelihood of yes and no

Reimplemented from Bayesable< Args... >.

◆ compute_model_predictions()

virtual std::map<typename HYP::output_t, double> MyGrammarHypothesis::compute_model_predictions ( const data_t human_data,
const size_t  i,
const Matrix hposterior 
) const
inlineoverridevirtual

!

!

◆ human_chance_lp()

virtual double MyGrammarHypothesis::human_chance_lp ( const typename datum_t::output_t &  r,
const datum_t hd 
) const
inlineoverridevirtual

◆ recompute_LL()

virtual void MyGrammarHypothesis::recompute_LL ( std::vector< HYP > &  hypotheses,
const data_t human_data 
)
inlineoverridevirtual

!

!

◆ remove_strings_and_renormalize()

static void MyGrammarHypothesis::remove_strings_and_renormalize ( DiscreteDistribution< S > &  M,
datum_t::data_t *  dptr,
const size_t  n 
)
inlinestatic

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