28 void append(
const string& key,
const ArrayXf& value) {
30 storage[key] = vector<ArrayXf>{value};
35 vector<ArrayXf>
getList(
const string& key) {
40 static vector<ArrayXf> empty_list;
49 vector<string> result;
50 for (
const auto& pair :
storage) {
51 result.push_back(pair.first);
71 template<Brush::ProgramType PT>
79 while(spot != simplified_program.
Tree.end())
84 if (spot.node->data.get_prob_change() > 0
88 if (simplified_program.
size_at(spot) < 10
95 auto res =
query(spot, d);
98 auto key = res.value();
99 const tree<Node> branch(spot);
103 }
else if (spot.node->get_size(
false) <
equivalentExpression[key].begin().node->get_size(
false)){
105 }
else if (spot.node->get_size(
false) >
equivalentExpression[key].begin().node->get_size(
false)){
107 simplified_program.
Tree.erase_children(spot);
108 spot = simplified_program.
Tree.move_ontop(spot, simplified_branch.begin());
115 program.
Tree = simplified_program.
Tree;
117 return simplified_program;
126 vector<string>
hash(
const ArrayXf& inputPoint);
holds variable type data.
vector< ArrayXf > getList(const string &key)
void append(const string &key, const ArrayXf &value)
map< string, vector< ArrayXf > > storage
Program< PT > simplify_tree(Program< PT > &program, const SearchSpace &ss, const Dataset &d)
void initUniformPlanes(int hashSize, int inputDim, int numPlanes)
vector< MatrixXf > uniformPlanes
optional< pair< size_t, string > > query(TreeIter &spot, const Dataset &d)
void index(TreeIter &spot, const Dataset &d)
vector< string > hash(const ArrayXf &inputPoint)
map< pair< size_t, string >, tree< Node > > equivalentExpression
< nsga2 selection operator for getting the front
auto Isnt(DataType dt) -> bool
tree< Node >::pre_order_iterator TreeIter
class holding the data for a node in a tree.
An individual program, a.k.a. model.
int size_at(Iter &top, bool include_weight=true) const
count the size of a given subtree, optionally including the weights in weighted nodes....
Holds a search space, consisting of operations and terminals and functions, and methods to sample tha...