GEGELATI

Loading...
Searching...
No Matches
learningParameters.h
1
39#ifndef LEARNING_PARAMETERS_H
40#define LEARNING_PARAMETERS_H
41
42#include "mutator/mutationParameters.h"
43#include "selector/selectionParameters.h"
44#include <thread>
45
46namespace Learn {
54 typedef struct LearningParameters
55 {
58 Mutator::MutationParameters mutation;
59
62 Selector::SelectionParameters selection;
63
65 inline static const std::string archiveSizeComment =
66 "// Number of recordings held in the Archive.\n"
67 "// \"archiveSize\" : 50, // Default value";
69 size_t archiveSize = 50;
70
72 inline static const std::string archivingProbabilityComment =
73 "// Probability of archiving the result of each Program "
74 "execution.\n"
75 "// \"archivingProbability\" : 0.05, // Default value";
77 double archivingProbability = 0.05;
78
80 inline static const std::string nbIterationsPerPolicyEvaluationComment =
81 "// Number of evaluation of each root per generation.\n"
82 "// \"nbIterationsPerPolicyEvaluation\" : 5, // Default value";
90 uint64_t nbIterationsPerPolicyEvaluation = 5;
91
93 inline static const std::string nbIterationsPerPolicyValidationComment =
94 "// Number of evaluation of each root per generation.\n"
95 "// \"nbIterationsPerPolicyValidation\" : 5, // Default value";
100 uint64_t nbIterationsPerPolicyValidation = 5;
101
103 inline static const std::string maxNbActionsPerEvalComment =
104 "// Maximum number of actions performed on the learning "
105 "environment during the\n"
106 "// each evaluation of a root.\n"
107 "// \"maxNbActionsPerEval\" : 1000, // Default value";
110 uint64_t maxNbActionsPerEval = 1000;
111
113 inline static const std::string nbGenerationsComment =
114 "// Number of generations of the training.\n"
115 "// \"nbGenerations\" : 500, // Default value";
117 uint64_t nbGenerations = 500;
118
120 inline static const std::string maxNbEvaluationPerPolicyComment =
121 "// Maximum number of times a given root is evaluated."
122 "After this number is\n"
123 "// reached, possibly after several generations, the score of the "
124 "root will be\n"
125 "// fixed, and no further evaluation will be done.\n"
126 "// \"maxNbEvaluationPerPolicy\" : 1000, // Default value";
129 size_t maxNbEvaluationPerPolicy = 1000;
130
132 inline static const std::string nbRegistersComment =
133 "// Number of registers for the Program execution.\n"
134 "// \"nbRegisters\" : 8, // Default value";
136 size_t nbRegisters = 8;
137
139 inline static const std::string nbProgramConstantComment =
140 "// Number of Constant available in each Program.\n"
141 "// \"nbProgramConstant\" : 0, // Default value";
143 size_t nbProgramConstant = 0;
144
146 inline static const std::string nbThreadsComment =
147 "// [Only used in ParallelLearningAgent and child classes.]\n"
148 "// Number of threads used for the training process.\n"
149 "// When undefined in the json file, this parameter is "
150 "automatically set to the\n"
151 "// number of cores of the CPU.\n"
152 "// /* \"nbThreads\" : 0,*/ // Commented by default";
163 size_t nbThreads = std::thread::hardware_concurrency();
164
166 inline static const std::string activationFunctionComment =
167 "// string that indicate the activation function used for "
168 "continuous actions \n"
169 "// \"activationFunction\" : 'none', // Default value";
172 std::string activationFunction = "none";
173
175 inline static const std::string doValidationComment =
176 "// Boolean used to activate an evaluation of the surviving roots "
177 "in validation\n"
178 "// mode after the training at each generation.\n"
179 "// \"doValidation\" : false, // Default value";
182 bool doValidation = false;
183
185 inline static const std::string stepValidationComment =
186 "// Value to indicate how many generation between each validation "
187 "step\n"
188 "// \"stepValidation\" : 1, // Default value";
190 uint64_t stepValidation = 1;
191 } LearningParameters;
192}; // namespace Learn
193
194#endif
Learn
Definition classificationLearningEnvironment.h:44
Learn::LearningParameters
struct Learn::LearningParameters LearningParameters
Structure for simplifying the transmission of LearningParameters to functions.
Learn::LearningParameters
Structure for simplifying the transmission of LearningParameters to functions.
Definition learningParameters.h:55
Learn::LearningParameters::selection
Selector::SelectionParameters selection
Definition learningParameters.h:62
Learn::LearningParameters::nbProgramConstant
size_t nbProgramConstant
Number of Constants available in a program.
Definition learningParameters.h:143
Learn::LearningParameters::nbProgramConstantComment
static const std::string nbProgramConstantComment
JSon comment.
Definition learningParameters.h:139
Learn::LearningParameters::mutation
Mutator::MutationParameters mutation
Definition learningParameters.h:58
Learn::LearningParameters::activationFunctionComment
static const std::string activationFunctionComment
JSon comment.
Definition learningParameters.h:166
Learn::LearningParameters::nbRegistersComment
static const std::string nbRegistersComment
JSon comment.
Definition learningParameters.h:132
Learn::LearningParameters::nbRegisters
size_t nbRegisters
Number of registers for the Program execution.
Definition learningParameters.h:136
Learn::LearningParameters::archivingProbability
double archivingProbability
Probability of archiving the result of each Program execution.
Definition learningParameters.h:77
Learn::LearningParameters::maxNbEvaluationPerPolicy
size_t maxNbEvaluationPerPolicy
Definition learningParameters.h:129
Learn::LearningParameters::archiveSize
size_t archiveSize
Number of recordings held in the Archive.
Definition learningParameters.h:69
Learn::LearningParameters::nbThreadsComment
static const std::string nbThreadsComment
JSon comment.
Definition learningParameters.h:146
Learn::LearningParameters::maxNbActionsPerEval
uint64_t maxNbActionsPerEval
Definition learningParameters.h:110
Learn::LearningParameters::maxNbActionsPerEvalComment
static const std::string maxNbActionsPerEvalComment
JSon comment.
Definition learningParameters.h:103
Learn::LearningParameters::stepValidationComment
static const std::string stepValidationComment
JSon comment.
Definition learningParameters.h:185
Learn::LearningParameters::nbGenerations
uint64_t nbGenerations
Number of generations of the training.
Definition learningParameters.h:117
Learn::LearningParameters::activationFunction
std::string activationFunction
Definition learningParameters.h:172
Learn::LearningParameters::stepValidation
uint64_t stepValidation
Value to indicate how many generation between each validation step.
Definition learningParameters.h:190
Learn::LearningParameters::maxNbEvaluationPerPolicyComment
static const std::string maxNbEvaluationPerPolicyComment
JSon comment.
Definition learningParameters.h:120
Learn::LearningParameters::nbGenerationsComment
static const std::string nbGenerationsComment
JSon comment.
Definition learningParameters.h:113
Learn::LearningParameters::nbIterationsPerPolicyEvaluationComment
static const std::string nbIterationsPerPolicyEvaluationComment
JSon comment.
Definition learningParameters.h:80
Learn::LearningParameters::archivingProbabilityComment
static const std::string archivingProbabilityComment
JSon comment.
Definition learningParameters.h:72
Learn::LearningParameters::nbThreads
size_t nbThreads
Number of threads (ParallelLearningAgent only)
Definition learningParameters.h:163
Learn::LearningParameters::archiveSizeComment
static const std::string archiveSizeComment
JSon comment.
Definition learningParameters.h:65
Learn::LearningParameters::doValidationComment
static const std::string doValidationComment
JSon comment.
Definition learningParameters.h:175
Learn::LearningParameters::nbIterationsPerPolicyValidationComment
static const std::string nbIterationsPerPolicyValidationComment
JSon comment.
Definition learningParameters.h:93
Learn::LearningParameters::nbIterationsPerPolicyEvaluation
uint64_t nbIterationsPerPolicyEvaluation
Number of evaluation of each policy per generation.
Definition learningParameters.h:90
Learn::LearningParameters::doValidation
bool doValidation
Definition learningParameters.h:182
Learn::LearningParameters::nbIterationsPerPolicyValidation
uint64_t nbIterationsPerPolicyValidation
Number of evaluation of each policy per generation for validation.
Definition learningParameters.h:100
Mutator::MutationParameters
Structure holding all parameters affecting stochastic mutations.
Definition mutationParameters.h:333
Selector::SelectionParameters
Structure holding all parameters affecting selection.
Definition selectionParameters.h:99