|
| virtual DiscreteDistribution< output_t > | call (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...
|
| |
| | 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_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 |
| |
| 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>
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