GEGELATI

Loading...
Searching...
No Matches
Public Attributes | Static Public Attributes | List of all members
Learn::LearningParameters Struct Reference

Structure for simplifying the transmission of LearningParameters to functions. More...

`#include <learningParameters.h>`

## Public Attributes
Mutator::MutationParameters | mutation
size_t | archiveSize = 50
| Number of recordings held in the Archive.
double | archivingProbability = 0.05
| Probability of archiving the result of each Program execution.
uint64_t | nbIterationsPerPolicyEvaluation = 5
| Number of evaluation of each policy per generation.
uint64_t | nbIterationsPerPolicyValidation = 5
| Number of evaluation of each policy per generation for validation.
uint64_t | maxNbActionsPerEval = 1000
double | ratioDeletedRoots = 0.5
bool | useTournamentSelection = false
| If tournament of simple selection is used.
uint64_t | sizeTournament = 5
| Size of tournament if tournament selection is used.
uint64_t | nbGenerations = 500
| Number of generations of the training.
size_t | maxNbEvaluationPerPolicy = 1000
size_t | nbIterationsPerJob = 1
| Number of evaluations done for each job.
size_t | nbRegisters = 8
| Number of registers for the Program execution.
size_t | nbProgramConstant = 0
| Number of Constants available in a program.
size_t | nbThreads = std::thread::hardware_concurrency()
| Number of threads (ParallelLearningAgent only)
std::string | activationFunction = "none"
bool | doValidation = false
uint64_t | stepValidation = 1
| Value to indicate how many generation between each validation step.

## Static Public Attributes
static const std::string | archiveSizeComment
| JSon comment.
static const std::string | archivingProbabilityComment
| JSon comment.
static const std::string | nbIterationsPerPolicyEvaluationComment
| JSon comment.
static const std::string | nbIterationsPerPolicyValidationComment
| JSon comment.
static const std::string | maxNbActionsPerEvalComment
| JSon comment.
static const std::string | ratioDeletedRootsComment
| JSon comment.
static const std::string | useTournamentSelectionComment
| JSon comment.
static const std::string | sizeTournamentComment
| JSon comment.
static const std::string | nbGenerationsComment
| JSon comment.
static const std::string | maxNbEvaluationPerPolicyComment
| JSon comment.
static const std::string | nbIterationsPerJobComment
| JSon comment.
static const std::string | nbRegistersComment
| JSon comment.
static const std::string | nbProgramConstantComment
| JSon comment.
static const std::string | nbThreadsComment
| JSon comment.
static const std::string | activationFunctionComment
| JSon comment.
static const std::string | doValidationComment
| JSon comment.
static const std::string | stepValidationComment
| JSon comment.

## Detailed Description

Structure for simplifying the transmission of LearningParameters to functions.

When modifying this structure and its comments, you must also update the functions in the ParameterParser namespace.

## Member Data Documentation

## ◆ activationFunction

std::string Learn::LearningParameters::activationFunction = "none"

string that indicate the activation function used for continuous actions

## ◆ activationFunctionComment

const std::string Learn::LearningParameters::activationFunctionComment
| inline static

Initial value:
=
"// string that indicate the activation function used for "
"continuous actions \n"
"// \"activationFunction\" : 'none', // Default value"

JSon comment.

## ◆ archiveSizeComment

const std::string Learn::LearningParameters::archiveSizeComment
| inline static

Initial value:
=
"// Number of recordings held in the Archive.\n"
"// \"archiveSize\" : 50, // Default value"

JSon comment.

## ◆ archivingProbabilityComment

const std::string Learn::LearningParameters::archivingProbabilityComment
| inline static

Initial value:
=
"// Probability of archiving the result of each Program "
"execution.\n"
"// \"archivingProbability\" : 0.05, // Default value"

JSon comment.

## ◆ doValidation

bool Learn::LearningParameters::doValidation = false

Boolean set to true if the user wants a validation after each training, and false otherwise

## ◆ doValidationComment

const std::string Learn::LearningParameters::doValidationComment
| inline static

Initial value:
=
"// Boolean used to activate an evaluation of the surviving roots "
"in validation\n"
"// mode after the training at each generation.\n"
"// \"doValidation\" : false, // Default value"

JSon comment.

## ◆ maxNbActionsPerEval

uint64_t Learn::LearningParameters::maxNbActionsPerEval = 1000

Maximum number of actions performed on the learning environment during the each evaluation of a root

## ◆ maxNbActionsPerEvalComment

const std::string Learn::LearningParameters::maxNbActionsPerEvalComment
| inline static

Initial value:
=
"// Maximum number of actions performed on the learning "
"environment during the\n"
"// each evaluation of a root.\n"
"// \"maxNbActionsPerEval\" : 1000, // Default value"

JSon comment.

## ◆ maxNbEvaluationPerPolicy

size_t Learn::LearningParameters::maxNbEvaluationPerPolicy = 1000

Maximum number of times a given policy (i.e. a root TPGVertex) is evaluated.

## ◆ maxNbEvaluationPerPolicyComment

const std::string Learn::LearningParameters::maxNbEvaluationPerPolicyComment
| inline static

Initial value:
=
"// Maximum number of times a given root is evaluated."
"After this number is\n"
"// reached, possibly after several generations, the score of the "
"root will be\n"
"// fixed, and no further evaluation will be done.\n"
"// \"maxNbEvaluationPerPolicy\" : 1000, // Default value"

JSon comment.

## ◆ mutation

Mutator::MutationParameters Learn::LearningParameters::mutation

MutationParameters for controlling stochastic aspects of the learning process.

## ◆ nbGenerationsComment

const std::string Learn::LearningParameters::nbGenerationsComment
| inline static

Initial value:
=
"// Number of generations of the training.\n"
"// \"nbGenerations\" : 500, // Default value"

JSon comment.

## ◆ nbIterationsPerJob

size_t Learn::LearningParameters::nbIterationsPerJob = 1

Number of evaluations done for each job.

In some situations where the environments is not determinist, i.e. if the agent does exactly the same thing at the same moment but he can still make different scores in different runs, then it can be a good thing to evaluate several times a single job. It will statistically be more representative of the job.

Note than in LearningAgent and ParallelLearningAgent it is currently unused as the number of eval per job will simply be nbIterationsPerPolicyEvaluation.

The default value is to 1, that means a given job will be evaluated a single time and there will be as many jobs as nbIterationsPerPolicyEvaluation.

## ◆ nbIterationsPerJobComment

const std::string Learn::LearningParameters::nbIterationsPerJobComment
| inline static

Initial value:
=
"// [Only used in AdversarialLearningAgent.]\n"
"// Number of times each job is evaluated in the learning "
"process.\n"
"// Each root may belong to several jobs, hence this parameter "
"should be lower\n"
"// than the nbIterationsPerPolicyEvaluation parameter.\n"
"// \"nbIterationsPerJob\" : 1, // Default value"

JSon comment.

## ◆ nbIterationsPerPolicyEvaluation

uint64_t Learn::LearningParameters::nbIterationsPerPolicyEvaluation = 5

Number of evaluation of each policy per generation.

In LearningAgent and ParallelLearningAgent it is just the number of times the evaluations are repeated (that can produce a more representative result in non-deterministic environments). In adversarial mode, that represents the minimum number of evaluation of each root. Each root will be evaluated in several jobs, each job can be evaluated several times, but the total number of times a root appears in an evaluation will be nbIterationsPerPolicyEvaluation or a bit higher.

## ◆ nbIterationsPerPolicyEvaluationComment

const std::string Learn::LearningParameters::nbIterationsPerPolicyEvaluationComment
| inline static

Initial value:
=
"// Number of evaluation of each root per generation.\n"
"// \"nbIterationsPerPolicyEvaluation\" : 5, // Default value"

JSon comment.

## ◆ nbIterationsPerPolicyValidationComment

const std::string Learn::LearningParameters::nbIterationsPerPolicyValidationComment
| inline static

Initial value:
=
"// Number of evaluation of each root per generation.\n"
"// \"nbIterationsPerPolicyValidation\" : 5, // Default value"

JSon comment.

## ◆ nbProgramConstantComment

const std::string Learn::LearningParameters::nbProgramConstantComment
| inline static

Initial value:
=
"// Number of Constant available in each Program.\n"
"// \"nbProgramConstant\" : 0, // Default value"

JSon comment.

## ◆ nbRegistersComment

const std::string Learn::LearningParameters::nbRegistersComment
| inline static

Initial value:
=
"// Number of registers for the Program execution.\n"
"// \"nbRegisters\" : 8, // Default value"

JSon comment.

## ◆ nbThreads

size_t Learn::LearningParameters::nbThreads = std::thread::hardware_concurrency()

Number of threads (ParallelLearningAgent only)

Integer parameter controlling the number of threads used for parallel execution. Possible values are:

- default : Let the runtime decide using std::thread::hardware_concurrency().
- `0` or `1`: Do not use parallelism.
- `n > 1`: Set the number of threads explicitly.

## ◆ nbThreadsComment

const std::string Learn::LearningParameters::nbThreadsComment
| inline static

Initial value:
=
"// [Only used in ParallelLearningAgent and child classes.]\n"
"// Number of threads used for the training process.\n"
"// When undefined in the json file, this parameter is "
"automatically set to the\n"
"// number of cores of the CPU.\n"
"// /* \"nbThreads\" : 0,*/ // Commented by default"

JSon comment.

## ◆ ratioDeletedRoots

double Learn::LearningParameters::ratioDeletedRoots = 0.5

Percentage of deleted (and regenerated) root TPGVertex at each generation.

## ◆ ratioDeletedRootsComment

const std::string Learn::LearningParameters::ratioDeletedRootsComment
| inline static

Initial value:
=
"// Percentage of deleted (and regenerated) root TPGVertex at each "
"generation.\n"
"// \"ratioDeletedRoots\" : 0.5, // Default value"

JSon comment.

## ◆ sizeTournamentComment

const std::string Learn::LearningParameters::sizeTournamentComment
| inline static

Initial value:
=
"// Size of tournament if tournament selection is used.\n"
"// \"sizeTournament\" : 5, // Default value"

JSon comment.

## ◆ stepValidationComment

const std::string Learn::LearningParameters::stepValidationComment
| inline static

Initial value:
=
"// Value to indicate how many generation between each validation "
"step\n"
"// \"stepValidation\" : 1, // Default value"

JSon comment.

## ◆ useTournamentSelectionComment

const std::string Learn::LearningParameters::useTournamentSelectionComment
| inline static

Initial value:
=
"// If tournament of simple selection is used.\n"
"// \"useTournamentSelection\" : false, // Default value"

JSon comment.

The documentation for this struct was generated from the following file:

- D:/a/gegelati/gegelati/gegelatilib/include/learn/learningParameters.h