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  stepLimit(0),
26  explorationSteps(1),
27  gradientLimit(40),
28  doubleQLearning(false)
29  { /* Nothing to do here. */ }
30 
32  size_t numWorkers,
33  size_t updateInterval,
34  size_t targetNetworkSyncInterval,
35  size_t stepLimit,
36  size_t explorationSteps,
37  double stepSize,
38  double discount,
39  double gradientLimit,
40  bool doubleQLearning) :
41  numWorkers(numWorkers),
42  updateInterval(updateInterval),
43  targetNetworkSyncInterval(targetNetworkSyncInterval),
44  stepLimit(stepLimit),
45  explorationSteps(explorationSteps),
46  stepSize(stepSize),
47  discount(discount),
48  gradientLimit(gradientLimit),
49  doubleQLearning(doubleQLearning)
50  { /* Nothing to do here. */ }
51 
53  size_t NumWorkers() const { return numWorkers; }
55  size_t& NumWorkers() { return numWorkers; }
56 
58  size_t UpdateInterval() const { return updateInterval; }
60  size_t& UpdateInterval() { return updateInterval; }
61 
64  { return targetNetworkSyncInterval; }
66  size_t& TargetNetworkSyncInterval() { return targetNetworkSyncInterval; }
67 
69  size_t StepLimit() const { return stepLimit; }
74  size_t& StepLimit() { return stepLimit; }
75 
77  size_t ExplorationSteps() const { return explorationSteps; }
79  size_t& ExplorationSteps() { return explorationSteps; }
80 
82  double StepSize() const { return stepSize; }
84  double& StepSize() { return stepSize; }
85 
87  double Discount() const { return discount; }
89  double& Discount() { return discount; }
90 
92  double GradientLimit() const { return gradientLimit; }
94  double& GradientLimit() { return gradientLimit; }
95 
97  bool DoubleQLearning() const { return doubleQLearning; }
99  bool& DoubleQLearning() { return doubleQLearning; }
100 
101  private:
106  size_t numWorkers;
107 
114  size_t updateInterval;
115 
120  size_t targetNetworkSyncInterval;
121 
126  size_t stepLimit;
127 
133  size_t explorationSteps;
134 
139  double stepSize;
140 
145  double discount;
146 
151  double gradientLimit;
152 
157  bool doubleQLearning;
158 };
159 
160 } // namespace rl
161 } // namespace mlpack
162 
163 #endif
double & Discount()
Modify the discount rate for future reward.
size_t ExplorationSteps() const
Get the exploration steps.
.hpp
Definition: add_to_po.hpp:21
size_t NumWorkers() const
Get the amount of workers.
TrainingConfig(size_t numWorkers, size_t updateInterval, size_t targetNetworkSyncInterval, size_t stepLimit, size_t explorationSteps, double stepSize, double discount, double gradientLimit, bool doubleQLearning)
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.
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.