Fleet  0.0.9
Inference in the LOT
Classes | Functions | Variables
Main.cpp File Reference
#include <functional>
#include <cassert>
#include "Object.h"
#include "ShapeColorSizeObject.h"
#include "Grammar.h"
#include "Singleton.h"
#include "LOTHypothesis.h"
#include "TopN.h"
#include "ParallelTempering.h"
#include "Fleet.h"
Include dependency graph for Main.cpp:
This graph shows which files directly or indirectly include this file:

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 LOTHypothesis<MyHypothesis,MyInput,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 x.reliability, and otherwise a coin flip.
double compute_single_likelihood(const datum_t& x) override {
bool out = callOne(x.input, false);
return out == x.output ? log(x.reliability + (1.0-x.reliability)/2.0) : log((1.0-x.reliability)/2.0);
}
};
/*

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

Variable Documentation

◆ grammar

MyGrammar grammar