Feat C++ API
A feature engineering automation tool
|
Defines a population of programs and functions for constructing them. More...
#include <population.h>
Classes | |
struct | SameFitComplexity |
check for same fitness and complexity to filter uniqueness. More... | |
struct | SortComplexity |
Sort population in increasing complexity. More... | |
Public Member Functions | |
Population (int p=0) | |
~Population () | |
void | init (const Individual &starting_model, const Parameters ¶ms, bool random=false, string filename="") |
initialize population of programs with a starting model and/or from file More... | |
void | resize (int pop_size) |
update individual vector size More... | |
void | update (vector< size_t > survivors) |
reduce programs to the indices in survivors. More... | |
int | size () |
returns population size More... | |
void | add (Individual &) |
adds a program to the population. More... | |
const Individual | operator[] (size_t i) const |
setting and getting from individuals vector More... | |
const Individual & | operator[] (size_t i) |
string | print_eqns (bool just_offspring=false, string sep="\n") |
return population equations. More... | |
vector< size_t > | sorted_front (unsigned) |
return complexity-sorted Pareto front indices. More... | |
void | save (string filename) |
void | load (string filename) |
Public Attributes | |
vector< Individual > | individuals |
individual programs More... | |
Defines a population of programs and functions for constructing them.
Definition at line 27 of file population.h.
FT::Pop::Population::Population | ( | int | p = 0 | ) |
Definition at line 13 of file population.cc.
FT::Pop::Population::~Population | ( | ) |
Definition at line 22 of file population.cc.
void FT::Pop::Population::add | ( | Individual & | ind | ) |
adds a program to the population.
adds ind to individuals, giving it an open location and bookeeping.
Definition at line 112 of file population.cc.
void FT::Pop::Population::init | ( | const Individual & | starting_model, |
const Parameters & | params, | ||
bool | random = false , |
||
string | filename = "" |
||
) |
initialize population of programs with a starting model and/or from file
create random programs in the population, seeded by initial model weights and potentially saved models
Definition at line 38 of file population.cc.
void FT::Pop::Population::load | ( | string | filename | ) |
Definition at line 165 of file population.cc.
const Individual & FT::Pop::Population::operator[] | ( | size_t | i | ) |
Definition at line 35 of file population.cc.
const Individual FT::Pop::Population::operator[] | ( | size_t | i | ) | const |
setting and getting from individuals vector
Definition at line 33 of file population.cc.
string FT::Pop::Population::print_eqns | ( | bool | just_offspring = false , |
string | sep = "\n" |
||
) |
return population equations.
Definition at line 121 of file population.cc.
void FT::Pop::Population::resize | ( | int | pop_size | ) |
update individual vector size
Definition at line 25 of file population.cc.
void FT::Pop::Population::save | ( | string | filename | ) |
Definition at line 150 of file population.cc.
int FT::Pop::Population::size | ( | ) |
returns population size
Definition at line 31 of file population.cc.
vector< size_t > FT::Pop::Population::sorted_front | ( | unsigned | rank = 1 | ) |
return complexity-sorted Pareto front indices.
Definition at line 135 of file population.cc.
void FT::Pop::Population::update | ( | vector< size_t > | survivors | ) |
reduce programs to the indices in survivors.
cull population down to survivor indices.
Definition at line 97 of file population.cc.
vector<Individual> FT::Pop::Population::individuals |
individual programs
Definition at line 29 of file population.h.