-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq_learning_config.py
36 lines (33 loc) · 1.45 KB
/
q_learning_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##
## @brief Class for specifying the hyper parameters of the Q Learning algorithm
##
class QLearningConfig:
##
## @brief Constructs the object.
##
## @param self The object
## @param batch_size The batch size
## @param gamma The gamma (= the horizon)
## @param size_replay_min_to_train The size replay minimum to train
## @param learning_rate_start The learning rate start
## @param learning_rate_end The learning rate end
## @param time_learning_rate_end How many time steps needed to completely anneal the learning rate
##
def __init__(self, batch_size = 200, gamma = 0.95, size_replay_min_to_train = 100,
learning_rate_start = 1e-3, learning_rate_end = 1e-8, time_learning_rate_end = 10000):
self.batch_size = batch_size
self.gamma = gamma
self.size_replay_min_to_train = size_replay_min_to_train
#Learning Rate
self.learning_rate_start = learning_rate_start
self.learning_rate_end = learning_rate_end
self.time_learning_rate_end = time_learning_rate_end
##
## @brief Returns a string representation of the object.
##
## @param self The object
##
## @return String representation of the object.
##
def __repr__(self):
return "QLearning condig : {} {} {} {} {} {}".format(self.batch_size, self.gamma, self.size_replay_min_to_train, self.learning_rate_start, self.learning_rate_end, self.time_learning_rate_end)