Vita
|
Context object aggregating multiple related parameters into one structure. More...
#include <environment.h>
Classes | |
struct | de_parameters |
struct | mep_parameters |
struct | misc_parameters |
struct | statistics |
struct | team_parameters |
Public Member Functions | |
environment () | |
Class constructor. More... | |
environment & | init () |
Initialises the undefined parameters with "common" values. More... | |
bool | is_valid (bool) const |
void | xml (tinyxml2::XMLDocument *) const |
Saves the environment in XML format. More... | |
Public Attributes | |
alps::parameters | alps |
unsigned | brood_recombination = 0 |
This parameter controls the brood recombination/selection level (1 to turn it off). More... | |
unsigned | cache_size = 16 |
2^cache_size is the number of elements of the cache. More... | |
struct vita::environment::de_parameters | de |
facultative< unsigned > | dss = {} |
Enables Dynamic Subset Selection every dss generations. More... | |
trilean | elitism = trilean::unknown |
An elitist algorithm is one that ALWAYS retains in the population the best individual found so far. More... | |
unsigned | generations = 0 |
Maximun number of generations allowed before terminate a run. More... | |
unsigned | individuals = 0 |
Number of individuals in a layer of the population. More... | |
unsigned | layers = 0 |
Number of layers for the population. More... | |
unsigned | mate_zone = 0 |
This is used for the trivial geography scheme. More... | |
facultative< unsigned, 0 > | max_stuck_time = {} |
Used by some evolution strategies to stop a run when there aren't improvements within max_stuck_time generations. More... | |
struct vita::environment::mep_parameters | mep |
unsigned | min_individuals = 0 |
Minimum number of individuals in a layer of the population. More... | |
struct vita::environment::misc_parameters | misc |
double | p_cross = -1.0 |
Crossover probability. More... | |
double | p_mutation = -1.0 |
Mutation rate probability. More... | |
struct vita::environment::statistics | stat |
struct vita::environment::team_parameters | team |
model_measurements | threshold = model_measurements() |
Used to identify successfully learned (matched, classified, resolved...) examples. More... | |
unsigned | tournament_size = 0 |
Size of the tournament to choose the parents from. More... | |
facultative< unsigned > | validation_percentage = {} |
How much data should be reserved for the validation set? validation_percentage is the fraction of the original data that goes into the validation set. More... | |
Context object aggregating multiple related parameters into one structure.
A context object (as defined in the Context Object Pattern) aggregates multiple related parameters into one structure, so there needs to be only one common parameter passed amongst functions and classes.
Included values are used as parameters for object initializations and runtime execution control.
Definition at line 56 of file environment.h.
|
explicit |
environment & vita::environment::init | ( | ) |
Initialises the undefined parameters with "common" values.
Usually:
This function is mainly convenient for debugging purpose. The chosen values are reasonable but most likely far from ideal.
Definition at line 43 of file environment.cc.
bool vita::environment::is_valid | ( | bool | force_defined | ) | const |
[in] | force_defined | all the undefined / auto-tuned parameters have to be in a "well defined" state for the function to pass the test |
true
if the object passes the internal consistency check Definition at line 127 of file environment.cc.
void vita::environment::xml | ( | tinyxml2::XMLDocument * | d | ) | const |
Saves the environment in XML format.
[out] | d | output document for saving the environment |
Definition at line 69 of file environment.cc.
alps::parameters vita::environment::alps |
Definition at line 268 of file environment.h.
unsigned vita::environment::brood_recombination = 0 |
This parameter controls the brood recombination/selection level (1
to turn it off).
In nature it's common for organisms to produce many offspring and then neglect, abort, resorb, eat some of them or allow them to eat each other. There are various reasons for this behavior (e.g. progeny choice hypothesis by "Kozlowski & Stearns, 1989"). The phenomenon is known variously as soft selection, brood selection, spontaneous abortion. The "bottom line" of this behaviour in nature is the reduction of parental resource investment in offspring who are potentially less fit than others.
0
means undefined (auto-tune); Definition at line 160 of file environment.h.
unsigned vita::environment::cache_size = 16 |
2^cache_size
is the number of elements of the cache.
Definition at line 220 of file environment.h.
facultative<unsigned> vita::environment::dss = {} |
Enables Dynamic Subset Selection every dss
generations.
This parameter is used by the dss
validation strategy.
Definition at line 182 of file environment.h.
trilean vita::environment::elitism = trilean::unknown |
An elitist algorithm is one that ALWAYS retains in the population the best individual found so far.
With higher elitism the population will converge quicker but losing diversity.
Definition at line 116 of file environment.h.
unsigned vita::environment::generations = 0 |
Maximun number of generations allowed before terminate a run.
Definition at line 202 of file environment.h.
unsigned vita::environment::individuals = 0 |
Number of individuals in a layer of the population.
Definition at line 103 of file environment.h.
unsigned vita::environment::layers = 0 |
Number of layers for the population.
layers > 1
is like running n
evolutions "in parallel" (the sub-populations of each layer don't interact). A value greater than one is usually choosen for vita::basic_alps_es or with other strategies that allow migrants.Definition at line 98 of file environment.h.
unsigned vita::environment::mate_zone = 0 |
This is used for the trivial geography scheme.
The population is viewed as having a 1-dimensional spatial structure - actually a circle, as we consider the first and last locations to be adiacent. The production of an individual from location i
is permitted to involve only parents from i
's local neightborhood, where the neightborhood is defined as all individuals within distance mate_zone/2
of i
.
0
means auto-tune.std::numeric_limits<unsigned>::max()
disables the scheme.Definition at line 197 of file environment.h.
facultative<unsigned, 0> vita::environment::max_stuck_time = {} |
Used by some evolution strategies to stop a run when there aren't improvements within max_stuck_time
generations.
Default status is uninitialized (auto-tune).
Definition at line 208 of file environment.h.
unsigned vita::environment::min_individuals = 0 |
Minimum number of individuals in a layer of the population.
Some evolution strategies dynamically change the number of individuals of the population. This parameter avoids to drop below a predefined limit
Definition at line 111 of file environment.h.
double vita::environment::p_cross = -1.0 |
Crossover probability.
Definition at line 137 of file environment.h.
double vita::environment::p_mutation = -1.0 |
Mutation rate probability.
Mutation is one of the principal "search operators" used to transform programs in the Genetic Programming algorithm. It causes random changes in individuals.
p_cross + p_mutation != 1.0
: p_mutation
is the probability to mutate a gene; it's not the probability of choosing the mutation operator (which depends depends on the recombination algorithm).Definition at line 132 of file environment.h.
model_measurements vita::environment::threshold = model_measurements() |
Used to identify successfully learned (matched, classified, resolved...) examples.
By default only fitness is considered.
Definition at line 266 of file environment.h.
unsigned vita::environment::tournament_size = 0 |
Size of the tournament to choose the parents from.
Tournament sizes tend to be small relative to the population size. The ratio of tournament size to population size can be used as a measure of selective pressure.
Definition at line 172 of file environment.h.
facultative<unsigned> vita::environment::validation_percentage = {} |
How much data should be reserved for the validation set? validation_percentage
is the fraction of the original data that goes into the validation set.
This parameter is used by the holdout_validation
strategy.
Definition at line 217 of file environment.h.