Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
inexact.cpp
Go to the documentation of this file.
1#include "inexact.h"
2
3
4// simplification maps are based on trainingdata
5// should ignore fixed nodes ---> does not change subtrees if they contain fixed nodes
6// should I implement json serialization?
7
8namespace Brush { namespace Simpl{
9
10// Inexact_simplifier* Inexact_simplifier::instance = NULL;
11
15
16
17void Inexact_simplifier::init(int hashSize, const Dataset &data, int numPlanes)
18{
19 // The greater the number of planes, the more accurate the hash, but the slower the search
20
21 // cut-off for performance at 100 samples
23
24 uniformPlanes.clear();
25 for (int i=0; i<numPlanes; ++i)
26 {
27 MatrixXf plane = MatrixXf::Random(hashSize, inputDim);
28 // plane /= plane.norm();
29 uniformPlanes.push_back(plane);
30 }
31
33 for (const auto& dtype : data.unique_data_types)
34 equivalentExpressions[dtype] = HashStorage(numPlanes);
35}
36
37
39
40} // Simply
41} // Brush
holds variable type data.
Definition data.h:51
int get_n_samples() const
Definition data.h:222
std::vector< DataType > unique_data_types
keeps track of the unique data types in the dataset.
Definition data.h:62
Dataset get_training_data() const
Definition data.cpp:197
vector< MatrixXf > uniformPlanes
Definition inexact.h:424
void init(int hashSize, const Dataset &data, int numPlanes)
Definition inexact.cpp:17
std::unordered_map< DataType, HashStorage > equivalentExpressions
Definition inexact.h:422
< nsga2 selection operator for getting the front
Definition bandit.cpp:4