Mungojerrie  1.1
Mungojerrie
Learner.hh
Go to the documentation of this file.
1 #ifndef LEARNER_
2 #define LEARNER_
3 
46 #include "Gym.hh"
47 
49  LearnerOptions() {
50  saveQFilename = "";
51  loadQFilename = "";
52  checkpointFreq = 0;
53  saveStratFilename = "";
54  }
55  bool isBDP;
56  bool dotLearn;
57  std::string dotLearnFilename;
58  bool prismLearn;
59  std::string prismLearnFilename;
60  Verbosity::Level verbosity;
61  bool statsOn;
62  std::string saveQFilename;
63  std::string loadQFilename;
64  double checkpointFreq;
65  std::string saveStratFilename;
66  bool progressBar;
67  bool parallelizedUpdate;
68 };
69 
70 class Learner {
71 public:
72  friend std::ostream & operator<<(std::ostream & os, Qtype const & Q);
74  Learner(Gym gym, LearnerOptions options);
91  void SarsaLambda(double lambda, bool replacingTrace, unsigned int numEpisodes,
92  double alpha, double linearAlphaDecay, double discount,
93  double epsilon, double linearExploreDecay, double initValue);
107  void DoubleQLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay,
108  double discount, double epsilon, double linearExploreDecay, double initValue);
122  void QLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay,
123  double discount, double epsilon, double linearExploreDecay, double initValue);
140  void DifferentialQLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay,
141  double epsilon, double linearExploreDecay, double eta,
142  double initValue);
143 private:
144  Gym gym;
145  bool isBDP;
146  bool dotLearn;
147  bool prismLearn;
148  std::string dotLearnFilename;
149  std::string prismLearnFilename;
150  Verbosity::Level verbosity;
151  bool statsOn;
152  std::string saveQFilename;
153  std::string loadQFilename;
154  double checkpointFreq;
155  std::string saveStratFilename;
156  bool progressBar;
157  bool parallelizedUpdate;
158  static int constexpr progressBarLength = 25;
159 };
160 
161 #endif
Gym.hh
Interface between learner and model/objective.
LearnerOptions
Definition: Learner.hh:48
Learner::DifferentialQLearning
void DifferentialQLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay, double epsilon, double linearExploreDecay, double eta, double initValue)
Runs the Differential Q-learning algorithm.
Definition: Learner.cc:854
Learner::Learner
Learner(Gym gym, LearnerOptions options)
Constructor for learner.
Definition: Learner.cc:47
Learner::QLearning
void QLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay, double discount, double epsilon, double linearExploreDecay, double initValue)
Runs the Q-learning algorithm.
Definition: Learner.cc:609
Gym
Class for a learning interface.
Definition: Gym.hh:253
Learner
Definition: Learner.hh:70
Learner::SarsaLambda
void SarsaLambda(double lambda, bool replacingTrace, unsigned int numEpisodes, double alpha, double linearAlphaDecay, double discount, double epsilon, double linearExploreDecay, double initValue)
Runs the Sarsa( ) algorithm.
Definition: Learner.cc:225
Learner::DoubleQLearning
void DoubleQLearning(unsigned int numEpisodes, double alpha, double linearAlphaDecay, double discount, double epsilon, double linearExploreDecay, double initValue)
Runs the Double Q-learning algorithm.
Definition: Learner.cc:406