GEGELATI
Loading...
Searching...
No Matches
learningParameters.h
1
40#ifndef LEARNING_PARAMETERS_H
41#define LEARNING_PARAMETERS_H
42
43#include "mutator/mutationParameters.h"
44#include "selector/selectionParameters.h"
45#include <thread>
46
47namespace Learn {
55 typedef struct LearningParameters
56 {
60
64
66 inline static const std::string archiveSizeComment =
67 "// Number of recordings held in the Archive.\n"
68 "// \"archiveSize\" : 50, // Default value";
70 size_t archiveSize = 50;
71
73 inline static const std::string archivingProbabilityComment =
74 "// Probability of archiving the result of each Program "
75 "execution.\n"
76 "// \"archivingProbability\" : 0.05, // Default value";
78 double archivingProbability = 0.05;
79
81 inline static const std::string nbIterationsPerPolicyEvaluationComment =
82 "// Number of evaluation of each root per generation.\n"
83 "// \"nbIterationsPerPolicyEvaluation\" : 5, // Default value";
92
94 inline static const std::string nbIterationsPerPolicyValidationComment =
95 "// Number of evaluation of each root per generation.\n"
96 "// \"nbIterationsPerPolicyValidation\" : 5, // Default value";
102
104 inline static const std::string maxNbActionsPerEvalComment =
105 "// Maximum number of actions performed on the learning "
106 "environment during the\n"
107 "// each evaluation of a root.\n"
108 "// \"maxNbActionsPerEval\" : 1000, // Default value";
111 uint64_t maxNbActionsPerEval = 1000;
112
114 inline static const std::string nbGenerationsComment =
115 "// Number of generations of the training.\n"
116 "// \"nbGenerations\" : 500, // Default value";
118 uint64_t nbGenerations = 500;
119
121 inline static const std::string maxNbEvaluationPerPolicyComment =
122 "// Maximum number of times a given root is evaluated."
123 "After this number is\n"
124 "// reached, possibly after several generations, the score of the "
125 "root will be\n"
126 "// fixed, and no further evaluation will be done.\n"
127 "// \"maxNbEvaluationPerPolicy\" : 1000, // Default value";
131
133 inline static const std::string nbRegistersComment =
134 "// Number of registers for the Program execution.\n"
135 "// \"nbRegisters\" : 8, // Default value";
137 size_t nbRegisters = 8;
138
140 inline static const std::string nbProgramConstantComment =
141 "// Number of Constant available in each Program.\n"
142 "// \"nbProgramConstant\" : 0, // Default value";
145
147 inline static const std::string nbThreadsComment =
148 "// [Only used in ParallelLearningAgent and child classes.]\n"
149 "// Number of threads used for the training process.\n"
150 "// When undefined in the json file, this parameter is "
151 "automatically set to the\n"
152 "// number of cores of the CPU.\n"
153 "// /* \"nbThreads\" : 0,*/ // Commented by default";
164 size_t nbThreads = std::thread::hardware_concurrency();
165
167 inline static const std::string detailedTimingComment =
168 "// Boolean used to activate detailed timing during learning.\n"
169 "// \"detailedTiming\" : false, // Default value";
171 bool detailedTiming = false;
172
174 inline static const std::string activationFunctionComment =
175 "// string that indicate the activation function used for "
176 "continuous actions \n"
177 "// \"activationFunction\" : 'none', // Default value";
180 std::string activationFunction = "none";
181
183 inline static const std::string doValidationComment =
184 "// Boolean used to activate an evaluation of the surviving roots "
185 "in validation\n"
186 "// mode after the training at each generation.\n"
187 "// \"doValidation\" : false, // Default value";
190 bool doValidation = false;
191
193 inline static const std::string stepValidationComment =
194 "// Value to indicate how many generation between each validation "
195 "step\n"
196 "// \"stepValidation\" : 1, // Default value";
198 uint64_t stepValidation = 1;
200}; // namespace Learn
201
202#endif
Definition classificationLearningEnvironment.h:44
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:56
Selector::SelectionParameters selection
Definition learningParameters.h:63
size_t nbProgramConstant
Number of Constants available in a program.
Definition learningParameters.h:144
static const std::string nbProgramConstantComment
JSon comment.
Definition learningParameters.h:140
Mutator::MutationParameters mutation
Definition learningParameters.h:59
static const std::string activationFunctionComment
JSon comment.
Definition learningParameters.h:174
static const std::string nbRegistersComment
JSon comment.
Definition learningParameters.h:133
size_t nbRegisters
Number of registers for the Program execution.
Definition learningParameters.h:137
double archivingProbability
Probability of archiving the result of each Program execution.
Definition learningParameters.h:78
size_t maxNbEvaluationPerPolicy
Definition learningParameters.h:130
size_t archiveSize
Number of recordings held in the Archive.
Definition learningParameters.h:70
static const std::string nbThreadsComment
JSon comment.
Definition learningParameters.h:147
uint64_t maxNbActionsPerEval
Definition learningParameters.h:111
static const std::string maxNbActionsPerEvalComment
JSon comment.
Definition learningParameters.h:104
static const std::string stepValidationComment
JSon comment.
Definition learningParameters.h:193
uint64_t nbGenerations
Number of generations of the training.
Definition learningParameters.h:118
std::string activationFunction
Definition learningParameters.h:180
bool detailedTiming
enable detailed timing during learning
Definition learningParameters.h:171
uint64_t stepValidation
Value to indicate how many generation between each validation step.
Definition learningParameters.h:198
static const std::string maxNbEvaluationPerPolicyComment
JSon comment.
Definition learningParameters.h:121
static const std::string detailedTimingComment
JSon comment.
Definition learningParameters.h:167
static const std::string nbGenerationsComment
JSon comment.
Definition learningParameters.h:114
static const std::string nbIterationsPerPolicyEvaluationComment
JSon comment.
Definition learningParameters.h:81
static const std::string archivingProbabilityComment
JSon comment.
Definition learningParameters.h:73
size_t nbThreads
Number of threads (ParallelLearningAgent only)
Definition learningParameters.h:164
static const std::string archiveSizeComment
JSon comment.
Definition learningParameters.h:66
static const std::string doValidationComment
JSon comment.
Definition learningParameters.h:183
static const std::string nbIterationsPerPolicyValidationComment
JSon comment.
Definition learningParameters.h:94
uint64_t nbIterationsPerPolicyEvaluation
Number of evaluation of each policy per generation.
Definition learningParameters.h:91
bool doValidation
Definition learningParameters.h:190
uint64_t nbIterationsPerPolicyValidation
Number of evaluation of each policy per generation for validation.
Definition learningParameters.h:101
Structure holding all parameters affecting stochastic mutations.
Definition mutationParameters.h:333
Structure holding all parameters affecting selection.
Definition selectionParameters.h:97