mlpack
training_config.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_RL_TRAINING_CONFIG_HPP
14 #define MLPACK_METHODS_RL_TRAINING_CONFIG_HPP
15 
16 namespace mlpack {
17 namespace rl {
18 
20 {
21  public:
22  TrainingConfig() :
23  numWorkers(1),
24  updateInterval(1),
25  targetNetworkSyncInterval(100),
26  stepLimit(200),
27  explorationSteps(1),
28  stepSize(0.01),
29  discount(0.99),
30  gradientLimit(40),
31  doubleQLearning(false),
32  noisyQLearning(false),
33  isCategorical(false),
34  atomSize(51),
35  vMin(0),
36  vMax(200),
37  rho(0.005)
38  { /* Nothing to do here. */ }
39 
41  size_t numWorkers,
42  size_t updateInterval,
43  size_t targetNetworkSyncInterval,
44  size_t stepLimit,
45  size_t explorationSteps,
46  double stepSize,
47  double discount,
48  double gradientLimit,
49  bool doubleQLearning,
50  bool noisyQLearning,
51  bool isCategorical,
52  size_t atomSize,
53  double vMin,
54  double vMax,
55  double rho) :
56  numWorkers(numWorkers),
57  updateInterval(updateInterval),
58  targetNetworkSyncInterval(targetNetworkSyncInterval),
59  stepLimit(stepLimit),
60  explorationSteps(explorationSteps),
61  stepSize(stepSize),
62  discount(discount),
63  gradientLimit(gradientLimit),
64  doubleQLearning(doubleQLearning),
65  noisyQLearning(noisyQLearning),
66  isCategorical(isCategorical),
67  atomSize(atomSize),
68  vMin(vMin),
69  vMax(vMax),
70  rho(rho)
71  { /* Nothing to do here. */ }
72 
74  size_t NumWorkers() const { return numWorkers; }
76  size_t& NumWorkers() { return numWorkers; }
77 
79  size_t UpdateInterval() const { return updateInterval; }
81  size_t& UpdateInterval() { return updateInterval; }
82 
85  { return targetNetworkSyncInterval; }
87  size_t& TargetNetworkSyncInterval() { return targetNetworkSyncInterval; }
88 
90  size_t StepLimit() const { return stepLimit; }
95  size_t& StepLimit() { return stepLimit; }
96 
98  size_t ExplorationSteps() const { return explorationSteps; }
100  size_t& ExplorationSteps() { return explorationSteps; }
101 
103  double StepSize() const { return stepSize; }
105  double& StepSize() { return stepSize; }
106 
108  double Discount() const { return discount; }
110  double& Discount() { return discount; }
111 
113  double GradientLimit() const { return gradientLimit; }
115  double& GradientLimit() { return gradientLimit; }
116 
118  bool DoubleQLearning() const { return doubleQLearning; }
120  bool& DoubleQLearning() { return doubleQLearning; }
121 
123  bool NoisyQLearning() const { return noisyQLearning; }
125  bool& NoisyQLearning() { return noisyQLearning; }
126 
128  bool IsCategorical() const { return isCategorical; }
130  bool& IsCategorical() { return isCategorical; }
131 
133  size_t AtomSize() const { return atomSize; }
135  size_t& AtomSize() { return atomSize; }
136 
138  double VMin() const { return vMin; }
140  double& VMin() { return vMin; }
141 
143  double VMax() const { return vMax; }
145  double& VMax() { return vMax; }
146 
148  double Rho() const { return rho; }
150  double& Rho() { return rho; }
151 
152  private:
157  size_t numWorkers;
158 
165  size_t updateInterval;
166 
171  size_t targetNetworkSyncInterval;
172 
177  size_t stepLimit;
178 
184  size_t explorationSteps;
185 
190  double stepSize;
191 
196  double discount;
197 
202  double gradientLimit;
203 
208  bool doubleQLearning;
209 
214  bool noisyQLearning;
215 
220  bool isCategorical;
221 
226  size_t atomSize;
227 
232  double vMin;
233 
238  double vMax;
239 
244  double rho;
245 };
246 
247 } // namespace rl
248 } // namespace mlpack
249 
250 #endif
size_t & UpdateInterval()
Modify the update interval.
Definition: training_config.hpp:81
bool DoubleQLearning() const
Get the indicator of double q-learning.
Definition: training_config.hpp:118
size_t TargetNetworkSyncInterval() const
Get the interval for syncing target network.
Definition: training_config.hpp:84
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
size_t NumWorkers() const
Get the amount of workers.
Definition: training_config.hpp:74
double & VMin()
Modify the minimum value for support.
Definition: training_config.hpp:140
double GradientLimit() const
Get the limit of update gradient.
Definition: training_config.hpp:113
double VMax() const
Get the maximum value for support.
Definition: training_config.hpp:143
size_t & NumWorkers()
Modify the amount of workers.
Definition: training_config.hpp:76
double & Discount()
Modify the discount rate for future reward.
Definition: training_config.hpp:110
size_t UpdateInterval() const
Get the update interval.
Definition: training_config.hpp:79
double StepSize() const
Get the step size of the optimizer.
Definition: training_config.hpp:103
double VMin() const
Get the minimum value for support.
Definition: training_config.hpp:138
double Rho() const
Get the rho value for sac.
Definition: training_config.hpp:148
size_t StepLimit() const
Get the maximum steps of each episode.
Definition: training_config.hpp:90
double & StepSize()
Modify the step size of the optimizer.
Definition: training_config.hpp:105
size_t & TargetNetworkSyncInterval()
Modify the interval for syncing target network.
Definition: training_config.hpp:87
size_t & StepLimit()
Modify the maximum steps of each episode.
Definition: training_config.hpp:95
bool NoisyQLearning() const
Get the indicator of noisy q-learning.
Definition: training_config.hpp:123
Definition: training_config.hpp:19
bool & DoubleQLearning()
Modify the indicator of double q-learning.
Definition: training_config.hpp:120
double & Rho()
Modify the rho value for sac.
Definition: training_config.hpp:150
bool & NoisyQLearning()
Modify the indicator of double q-learning.
Definition: training_config.hpp:125
double & GradientLimit()
Modify the limit of update gradient.
Definition: training_config.hpp:115
size_t & ExplorationSteps()
Modify the exploration steps.
Definition: training_config.hpp:100
double Discount() const
Get the discount rate for future reward.
Definition: training_config.hpp:108
bool & IsCategorical()
Modify the indicator of categorical q-learning.
Definition: training_config.hpp:130
size_t ExplorationSteps() const
Get the exploration steps.
Definition: training_config.hpp:98
bool IsCategorical() const
Get the indicator of categorical q-learning.
Definition: training_config.hpp:128
double & VMax()
Modify the maximum value for support.
Definition: training_config.hpp:145
size_t AtomSize() const
Get the number of atoms.
Definition: training_config.hpp:133
size_t & AtomSize()
Modify the number of atoms.
Definition: training_config.hpp:135