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 <thread>
44
45 namespace Learn {
53 typedef struct LearningParameters
54 {
57 Mutator::MutationParameters mutation;
58
60 inline static const std::string archiveSizeComment =
61 "// Number of recordings held in the Archive.\n"
62 "// \"archiveSize\" : 50, // Default value";
64 size_t archiveSize = 50;
65
67 inline static const std::string archivingProbabilityComment =
68 "// Probability of archiving the result of each Program "
69 "execution.\n"
70 "// \"archivingProbability\" : 0.05, // Default value";
72 double archivingProbability = 0.05;
73
75 inline static const std::string nbIterationsPerPolicyEvaluationComment =
76 "// Number of evaluation of each root per generation.\n"
77 "// \"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 ratioDeletedRootsComment =
114 "// Percentage of deleted (and regenerated) root TPGVertex at each "
115 "generation.\n"
116 "// \"ratioDeletedRoots\" : 0.5, // Default value";
119 double ratioDeletedRoots = 0.5;
120
122 inline static const std::string useTournamentSelectionComment =
123 "// If tournament of simple selection is used.\n"
124 "// \"useTournamentSelection\" : false, // Default value";
126 bool useTournamentSelection = false;
127
129 inline static const std::string sizeTournamentComment =
130 "// Size of tournament if tournament selection is used.\n"
131 "// \"sizeTournament\" : 5, // Default value";
133 uint64_t sizeTournament = 5;
134
136 inline static const std::string nbGenerationsComment =
137 "// Number of generations of the training.\n"
138 "// \"nbGenerations\" : 500, // Default value";
140 uint64_t nbGenerations = 500;
141
143 inline static const std::string maxNbEvaluationPerPolicyComment =
144 "// Maximum number of times a given root is evaluated."
145 "After this number is\n"
146 "// reached, possibly after several generations, the score of the "
147 "root will be\n"
148 "// fixed, and no further evaluation will be done.\n"
149 "// \"maxNbEvaluationPerPolicy\" : 1000, // Default value";
152 size_t maxNbEvaluationPerPolicy = 1000;
153
155 inline static const std::string nbIterationsPerJobComment =
156 "// [Only used in AdversarialLearningAgent.]\n"
157 "// Number of times each job is evaluated in the learning "
158 "process.\n"
159 "// Each root may belong to several jobs, hence this parameter "
160 "should be lower\n"
161 "// than the nbIterationsPerPolicyEvaluation parameter.\n"
162 "// \"nbIterationsPerJob\" : 1, // Default value";
180 size_t nbIterationsPerJob = 1;
181
183 inline static const std::string nbRegistersComment =
184 "// Number of registers for the Program execution.\n"
185 "// \"nbRegisters\" : 8, // Default value";
187 size_t nbRegisters = 8;
188
190 inline static const std::string nbProgramConstantComment =
191 "// Number of Constant available in each Program.\n"
192 "// \"nbProgramConstant\" : 0, // Default value";
194 size_t nbProgramConstant = 0;
195
197 inline static const std::string nbThreadsComment =
198 "// [Only used in ParallelLearningAgent and child classes.]\n"
199 "// Number of threads used for the training process.\n"
200 "// When undefined in the json file, this parameter is "
201 "automatically set to the\n"
202 "// number of cores of the CPU.\n"
203 "// /* \"nbThreads\" : 0,*/ // Commented by default";
214 size_t nbThreads = std::thread::hardware_concurrency();
215
217 inline static const std::string activationFunctionComment =
218 "// string that indicate the activation function used for "
219 "continuous actions \n"
220 "// \"activationFunction\" : 'none', // Default value";
223 std::string activationFunction = "none";
224
226 inline static const std::string doValidationComment =
227 "// Boolean used to activate an evaluation of the surviving roots "
228 "in validation\n"
229 "// mode after the training at each generation.\n"
230 "// \"doValidation\" : false, // Default value";
233 bool doValidation = false;
234
236 inline static const std::string stepValidationComment =
237 "// Value to indicate how many generation between each validation "
238 "step\n"
239 "// \"stepValidation\" : 1, // Default value";
241 uint64_t stepValidation = 1;
242 } LearningParameters;
243}; // namespace Learn
244
245#endif
Learn
Definition adversarialEvaluationResult.h:45
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:54
Learn::LearningParameters::nbProgramConstant
size_t nbProgramConstant
Number of Constants available in a program.
Definition learningParameters.h:194
Learn::LearningParameters::nbIterationsPerJobComment
static const std::string nbIterationsPerJobComment
JSon comment.
Definition learningParameters.h:155
Learn::LearningParameters::nbProgramConstantComment
static const std::string nbProgramConstantComment
JSon comment.
Definition learningParameters.h:190
Learn::LearningParameters::useTournamentSelection
bool useTournamentSelection
If tournament of simple selection is used.
Definition learningParameters.h:126
Learn::LearningParameters::sizeTournament
uint64_t sizeTournament
Size of tournament if tournament selection is used.
Definition learningParameters.h:133
Learn::LearningParameters::mutation
Mutator::MutationParameters mutation
Definition learningParameters.h:57
Learn::LearningParameters::activationFunctionComment
static const std::string activationFunctionComment
JSon comment.
Definition learningParameters.h:217
Learn::LearningParameters::nbRegistersComment
static const std::string nbRegistersComment
JSon comment.
Definition learningParameters.h:183
Learn::LearningParameters::nbRegisters
size_t nbRegisters
Number of registers for the Program execution.
Definition learningParameters.h:187
Learn::LearningParameters::archivingProbability
double archivingProbability
Probability of archiving the result of each Program execution.
Definition learningParameters.h:72
Learn::LearningParameters::maxNbEvaluationPerPolicy
size_t maxNbEvaluationPerPolicy
Definition learningParameters.h:152
Learn::LearningParameters::archiveSize
size_t archiveSize
Number of recordings held in the Archive.
Definition learningParameters.h:64
Learn::LearningParameters::nbThreadsComment
static const std::string nbThreadsComment
JSon comment.
Definition learningParameters.h:197
Learn::LearningParameters::useTournamentSelectionComment
static const std::string useTournamentSelectionComment
JSon comment.
Definition learningParameters.h:122
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:236
Learn::LearningParameters::nbGenerations
uint64_t nbGenerations
Number of generations of the training.
Definition learningParameters.h:140
Learn::LearningParameters::activationFunction
std::string activationFunction
Definition learningParameters.h:223
Learn::LearningParameters::stepValidation
uint64_t stepValidation
Value to indicate how many generation between each validation step.
Definition learningParameters.h:241
Learn::LearningParameters::ratioDeletedRootsComment
static const std::string ratioDeletedRootsComment
JSon comment.
Definition learningParameters.h:113
Learn::LearningParameters::maxNbEvaluationPerPolicyComment
static const std::string maxNbEvaluationPerPolicyComment
JSon comment.
Definition learningParameters.h:143
Learn::LearningParameters::sizeTournamentComment
static const std::string sizeTournamentComment
JSon comment.
Definition learningParameters.h:129
Learn::LearningParameters::nbGenerationsComment
static const std::string nbGenerationsComment
JSon comment.
Definition learningParameters.h:136
Learn::LearningParameters::nbIterationsPerPolicyEvaluationComment
static const std::string nbIterationsPerPolicyEvaluationComment
JSon comment.
Definition learningParameters.h:75
Learn::LearningParameters::ratioDeletedRoots
double ratioDeletedRoots
Definition learningParameters.h:119
Learn::LearningParameters::archivingProbabilityComment
static const std::string archivingProbabilityComment
JSon comment.
Definition learningParameters.h:67
Learn::LearningParameters::nbThreads
size_t nbThreads
Number of threads (ParallelLearningAgent only)
Definition learningParameters.h:214
Learn::LearningParameters::archiveSizeComment
static const std::string archiveSizeComment
JSon comment.
Definition learningParameters.h:60
Learn::LearningParameters::doValidationComment
static const std::string doValidationComment
JSon comment.
Definition learningParameters.h:226
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:233
Learn::LearningParameters::nbIterationsPerPolicyValidation
uint64_t nbIterationsPerPolicyValidation
Number of evaluation of each policy per generation for validation.
Definition learningParameters.h:100
Learn::LearningParameters::nbIterationsPerJob
size_t nbIterationsPerJob
Number of evaluations done for each job.
Definition learningParameters.h:180
Mutator::MutationParameters
Structure holding all parameters affecting stochastic mutations.
Definition mutationParameters.h:315