Fleet  0.0.9
Inference in the LOT
Classes | Functions | Variables
Main.cpp File Reference
#include "ShapeColorSizeObject.h"
#include "Grammar.h"
#include "Singleton.h"
#include "DeterministicLOTHypothesis.h"
#include "TopN.h"
#include "ParallelTempering.h"
#include "Fleet.h"
#include "Builtins.h"
Include dependency graph for Main.cpp:

Classes

class  MyGrammar
 
More...
 

Functions

int main (int argc, char **argv)
 

Variables

MyGrammar grammar
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)
Define a class for handling my specific hypotheses and data. Everything is defaultly
a PCFG prior and regeneration proposals, but I have to define a likelihood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
class MyHypothesis final : public DeterministicLOTHypothesis<MyHypothesis,MyObject,bool,MyGrammar,&grammar> {
public:
using Super::Super; // inherit the constructors
// Now, if we defaultly assume that our data is a std::vector of t_data, then we
// can just define the likelihood of a single data point, which is here the true
// value with probability di.reliability, and otherwise a coin flip.
double compute_single_likelihood(const datum_t& di) override {
bool out = call(di.input, false);
return log((1.0-di.reliability)/2.0 + (out == di.output)*di.reliability);
}
};
/*

Main code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Variable Documentation

◆ grammar

MyGrammar grammar