|
| LOTHypothesis () |
|
| LOTHypothesis (Node &x) |
|
| LOTHypothesis (Node &&x) |
|
| LOTHypothesis (std::string s) |
|
| LOTHypothesis (const LOTHypothesis &c) |
|
| LOTHypothesis (const LOTHypothesis &&c) |
|
LOTHypothesis & | operator= (const LOTHypothesis &c) |
|
LOTHypothesis & | operator= (const LOTHypothesis &&c) |
|
virtual ProposalType | propose () const override |
| Default proposal is rational-rules style regeneration. More...
|
|
virtual this_t | restart () const override |
| This is used to restart chains, sampling from prior but ONLY for nodes that are can_resample. More...
|
|
Node & | get_value () |
|
const Node & | get_value () const |
|
void | set_value (Node &v, bool should_compile=true) |
| Set the value to v. (NOTE: This compiles into a program) More...
|
|
void | set_value (Node &&v, bool should_compile=true) |
|
Grammar_t * | get_grammar () const |
|
virtual double | compute_prior () override |
| Compute the prior – defaultly just the PCFG (grammar) prior. More...
|
|
virtual double | compute_single_likelihood (const datum_t &datum) override |
|
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="") const override |
|
virtual std::string | string (std::string prefix, bool usedot) const |
|
virtual size_t | hash () const override |
|
virtual bool | operator== (const this_t &h) const override |
| Equality is checked on equality of values; note that greater-than is still on posteriors. More...
|
|
virtual void | complete () override |
| Modify this hypothesis's value by (randomly) filling in all the gaps. 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 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...
|
|
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...
|
|
| MCMCable () |
|
virtual bool | operator!= (const this_t &h) const |
|
| 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_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="") |
|
virtual this_t | make_neighbor (int k) const |
| 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 | push_program (Program< _VirtualMachineState_t > &s, const short a) |
|
virtual void | push_program (Program< _VirtualMachineState_t > &s, const int a) |
|
virtual void | push_program (Program< _VirtualMachineState_t > &s, const std::string k) |
|
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual void LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::complete |
( |
| ) |
|
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual double LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::compute_prior |
( |
| ) |
|
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual double LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::compute_single_likelihood |
( |
const datum_t & |
datum | ) |
|
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
static this_t LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::deserialize |
( |
const std::string & |
s | ) |
|
|
inlinestatic |
Convert this from a string which was in a file.
- Parameters
-
- Returns
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual void LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::expand_to_neighbor |
( |
int |
k | ) |
|
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual size_t LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::hash |
( |
| ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual bool LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::is_evaluable |
( |
| ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual double LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::neighbor_prior |
( |
int |
k | ) |
|
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual int LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::neighbors |
( |
| ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual bool LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::operator== |
( |
const this_t & |
h | ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
size_t LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::recursion_count |
( |
| ) |
|
|
inline |
Count up how many times I use recursion – we keep a list of recursion here.
- Returns
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual this_t LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::restart |
( |
| ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual std::string LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::serialize |
( |
| ) |
const |
|
inlineoverridevirtual |
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
void LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::set_value |
( |
Node & |
v, |
|
|
bool |
should_compile = true |
|
) |
| |
|
inline |
Set the value to v. (NOTE: This compiles into a program)
- Parameters
-
template<typename this_t, typename _input_t, typename _output_t, typename _Grammar_t, _Grammar_t * grammar, typename _datum_t = defaultdatum_t<_input_t, _output_t>, typename _data_t = std::vector<_datum_t>, typename _VirtualMachineState_t = typename _Grammar_t::VirtualMachineState_t>
virtual std::string LOTHypothesis< this_t, _input_t, _output_t, _Grammar_t, grammar, _datum_t, _data_t, _VirtualMachineState_t >::string |
( |
std::string |
prefix = "" | ) |
const |
|
inlineoverridevirtual |