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:
23  numWorkers(1),
24  updateInterval(1),
25  targetNetworkSyncInterval(100),
26  stepLimit(0),
27  explorationSteps(1),
28  stepSize(0.01),
29  discount(0.99),
30  gradientLimit(40),
31  doubleQLearning(false),
32  noisyQLearning(false)
33  { /* Nothing to do here. */ }
34 
36  size_t numWorkers,
37  size_t updateInterval,
38  size_t targetNetworkSyncInterval,
39  size_t stepLimit,
40  size_t explorationSteps,
41  double stepSize,
42  double discount,
43  double gradientLimit,
44  bool doubleQLearning,
45  bool noisyQLearning) :
46  numWorkers(numWorkers),
47  updateInterval(updateInterval),
48  targetNetworkSyncInterval(targetNetworkSyncInterval),
49  stepLimit(stepLimit),
50  explorationSteps(explorationSteps),
51  stepSize(stepSize),
52  discount(discount),
53  gradientLimit(gradientLimit),
54  doubleQLearning(doubleQLearning),
55  noisyQLearning(noisyQLearning)
56  { /* Nothing to do here. */ }
57 
59  size_t NumWorkers() const { return numWorkers; }
61  size_t& NumWorkers() { return numWorkers; }
62 
64  size_t UpdateInterval() const { return updateInterval; }
66  size_t& UpdateInterval() { return updateInterval; }
67 
70  { return targetNetworkSyncInterval; }
72  size_t& TargetNetworkSyncInterval() { return targetNetworkSyncInterval; }
73 
75  size_t StepLimit() const { return stepLimit; }
80  size_t& StepLimit() { return stepLimit; }
81 
83  size_t ExplorationSteps() const { return explorationSteps; }
85  size_t& ExplorationSteps() { return explorationSteps; }
86 
88  double StepSize() const { return stepSize; }
90  double& StepSize() { return stepSize; }
91 
93  double Discount() const { return discount; }
95  double& Discount() { return discount; }
96 
98  double GradientLimit() const { return gradientLimit; }
100  double& GradientLimit() { return gradientLimit; }
101 
103  bool DoubleQLearning() const { return doubleQLearning; }
105  bool& DoubleQLearning() { return doubleQLearning; }
106 
108  bool NoisyQLearning() const { return noisyQLearning; }
110  bool& NoisyQLearning() { return noisyQLearning; }
111 
112  private:
117  size_t numWorkers;
118 
125  size_t updateInterval;
126 
131  size_t targetNetworkSyncInterval;
132 
137  size_t stepLimit;
138 
144  size_t explorationSteps;
145 
150  double stepSize;
151 
156  double discount;
157 
162  double gradientLimit;
163 
168  bool doubleQLearning;
169 
174  bool noisyQLearning;
175 };
176 
177 } // namespace rl
178 } // namespace mlpack
179 
180 #endif
double & Discount()
Modify the discount rate for future reward.
size_t ExplorationSteps() const
Get the exploration steps.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_po.hpp:21
bool NoisyQLearning() const
Get the indicator of noisy q-learning.
size_t NumWorkers() const
Get the amount of workers.
size_t StepLimit() const
Get the maximum steps of each episode.
size_t TargetNetworkSyncInterval() const
Get the interval for syncing target network.
size_t & StepLimit()
Modify the maximum steps of each episode.
size_t & TargetNetworkSyncInterval()
Modify the interval for syncing target network.
size_t UpdateInterval() const
Get the update interval.
double Discount() const
Get the discount rate for future reward.
size_t & NumWorkers()
Modify the amount of workers.
bool DoubleQLearning() const
Get the indicator of double q-learning.
size_t & ExplorationSteps()
Modify the exploration steps.
TrainingConfig(size_t numWorkers, size_t updateInterval, size_t targetNetworkSyncInterval, size_t stepLimit, size_t explorationSteps, double stepSize, double discount, double gradientLimit, bool doubleQLearning, bool noisyQLearning)
bool & DoubleQLearning()
Modify the indicator of double q-learning.
double GradientLimit() const
Get the limit of update gradient.
size_t & UpdateInterval()
Modify the update interval.
double & GradientLimit()
Modify the limit of update gradient.
double StepSize() const
Get the step size of the optimizer.
double & StepSize()
Modify the step size of the optimizer.
bool & NoisyQLearning()
Modify the indicator of double q-learning.