GEGELATI
learningParameters.h
1
38#ifndef LEARNING_PARAMETERS_H
39#define LEARNING_PARAMETERS_H
40
41#include "mutator/mutationParameters.h"
42#include <thread>
43
44namespace Learn {
52 typedef struct LearningParameters
53 {
57
59 inline static const std::string archiveSizeComment =
60 "// Number of recordings held in the Archive.\n"
61 "// \"archiveSize\" : 50, // Default value";
63 size_t archiveSize = 50;
64
66 inline static const std::string archivingProbabilityComment =
67 "// Probability of archiving the result of each Program "
68 "execution.\n"
69 "// \"archivingProbability\" : 0.05, // Default value";
71 double archivingProbability = 0.05;
72
74 inline static const std::string nbIterationsPerPolicyEvaluationComment =
75 "// Number of evaluation of each root per generation.\n"
76 "// \"nbIterationsPerPolicyEvaluation\" : 5, // Default value";
90
92 inline static const std::string maxNbActionsPerEvalComment =
93 "// Maximum number of actions performed on the learning "
94 "environment during the\n"
95 "// each evaluation of a root.\n"
96 "// \"maxNbActionsPerEval\" : 1000, // Default value";
99 uint64_t maxNbActionsPerEval = 1000;
100
102 inline static const std::string ratioDeletedRootsComment =
103 "// Percentage of deleted (and regenerated) root TPGVertex at each "
104 "generation.\n"
105 "// \"ratioDeletedRoots\" : 0.5, // Default value";
108 double ratioDeletedRoots = 0.5;
109
111 inline static const std::string nbGenerationsComment =
112 "// Number of generations of the training.\n"
113 "// \"nbGenerations\" : 500, // Default value";
115 uint64_t nbGenerations = 500;
116
118 inline static const std::string maxNbEvaluationPerPolicyComment =
119 "// Maximum number of times a given root is evaluated."
120 "After this number is\n"
121 "// reached, possibly after several generations, the score of the "
122 "root will be\n"
123 "// fixed, and no further evaluation will be done.\n"
124 "// \"maxNbEvaluationPerPolicy\" : 1000, // Default value";
128
130 inline static const std::string nbIterationsPerJobComment =
131 "// [Only used in AdversarialLearningAgent.]\n"
132 "// Number of times each job is evaluated in the learning "
133 "process.\n"
134 "// Each root may belong to several jobs, hence this parameter "
135 "should be lower\n"
136 "// than the nbIterationsPerPolicyEvaluation parameter.\n"
137 "// \"nbIterationsPerJob\" : 1, // Default value";
156
158 inline static const std::string nbRegistersComment =
159 "// Number of registers for the Program execution.\n"
160 "// \"nbRegisters\" : 8, // Default value";
162 size_t nbRegisters = 8;
163
165 inline static const std::string nbProgramConstantComment =
166 "// Number of Constant available in each Program.\n"
167 "// \"nbProgramConstant\" : 0, // Default value";
170
172 inline static const std::string nbThreadsComment =
173 "// [Only used in ParallelLearningAgent and child classes.]\n"
174 "// Number of threads used for the training process.\n"
175 "// When undefined in the json file, this parameter is "
176 "automatically set to the\n"
177 "// number of cores of the CPU.\n"
178 "// /* \"nbThreads\" : 0,*/ // Commented by default";
189 size_t nbThreads = std::thread::hardware_concurrency();
190
192 inline static const std::string doValidationComment =
193 "// Boolean used to activate an evaluation of the surviving roots "
194 "in validation\n"
195 "// mode after the training at each generation.\n"
196 "// \"doValidation\" : false, // Default value";
199 bool doValidation = false;
201}; // namespace Learn
202
203#endif
Definition: adversarialEvaluationResult.h:45
struct Learn::LearningParameters LearningParameters
Structure for simplifying the transmission of LearningParameters to functions.
Structure for simplifying the transmission of LearningParameters to functions.
Definition: learningParameters.h:53
size_t nbProgramConstant
Number of Constants available in a program.
Definition: learningParameters.h:169
static const std::string nbIterationsPerJobComment
JSon comment.
Definition: learningParameters.h:130
static const std::string nbProgramConstantComment
JSon comment.
Definition: learningParameters.h:165
Mutator::MutationParameters mutation
Definition: learningParameters.h:56
static const std::string nbRegistersComment
JSon comment.
Definition: learningParameters.h:158
size_t nbRegisters
Number of registers for the Program execution.
Definition: learningParameters.h:162
double archivingProbability
Probability of archiving the result of each Program execution.
Definition: learningParameters.h:71
size_t maxNbEvaluationPerPolicy
Definition: learningParameters.h:127
size_t archiveSize
Number of recordings held in the Archive.
Definition: learningParameters.h:63
static const std::string nbThreadsComment
JSon comment.
Definition: learningParameters.h:172
uint64_t maxNbActionsPerEval
Definition: learningParameters.h:99
static const std::string maxNbActionsPerEvalComment
JSon comment.
Definition: learningParameters.h:92
uint64_t nbGenerations
Number of generations of the training.
Definition: learningParameters.h:115
static const std::string ratioDeletedRootsComment
JSon comment.
Definition: learningParameters.h:102
static const std::string maxNbEvaluationPerPolicyComment
JSon comment.
Definition: learningParameters.h:118
static const std::string nbGenerationsComment
JSon comment.
Definition: learningParameters.h:111
static const std::string nbIterationsPerPolicyEvaluationComment
JSon comment.
Definition: learningParameters.h:74
double ratioDeletedRoots
Definition: learningParameters.h:108
static const std::string archivingProbabilityComment
JSon comment.
Definition: learningParameters.h:66
size_t nbThreads
Number of threads (ParallelLearningAgent only)
Definition: learningParameters.h:189
static const std::string archiveSizeComment
JSon comment.
Definition: learningParameters.h:59
static const std::string doValidationComment
JSon comment.
Definition: learningParameters.h:192
uint64_t nbIterationsPerPolicyEvaluation
Number of evaluation of each policy per generation.
Definition: learningParameters.h:89
bool doValidation
Definition: learningParameters.h:199
size_t nbIterationsPerJob
Number of evaluations done for each job.
Definition: learningParameters.h:155
Structure holding all parameters affecting stochastic mutations.
Definition: mutationParameters.h:198