-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
79 lines (74 loc) · 2.09 KB
/
config.py
File metadata and controls
79 lines (74 loc) · 2.09 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
In this file, you may edit the hyperparameters used for different environments.
memory_size: Maximum size of the replay memory.
observation_stack_size: Number of frames to stack together as a single observation.
n_episodes: Number of episodes to train for.
batch_size: Batch size used for training DQN.
target_update_frequency: How often to update the target network.
train_frequency: How often to train the DQN.
gamma: Discount factor.
lr: Learning rate used for optimizer.
eps_start: Starting value for epsilon (linear annealing).
eps_end: Final value for epsilon (linear annealing).
anneal_length: How many steps to anneal epsilon for.
n_actions: The number of actions can easily be accessed with env.action_space.n, but we do
some manual engineering to account for the fact that Pong has duplicate actions.
"""
# Hyperparameters for CartPole-v1
CartPole = {
'memory_size': 50000,
'n_episodes': 1000,
'batch_size': 32,
'target_update_frequency': 10,
'train_frequency': 1,
'gamma': 0.95,
'lr': 1e-4,
'eps_start': 1.0,
'eps_end': 0.05,
'anneal_length': 10**4,
'n_actions': 2,
}
# Hyperparameters for MountainCar-v0
MountainCar = {
'memory_size': 50000,
'n_episodes': 1000,
'batch_size': 32,
'target_update_frequency': 10,
'train_frequency': 1,
'gamma': 0.95,
'lr': 1e-4,
'eps_start': 1.0,
'eps_end': 0.05,
'anneal_length': 10**4,
'n_actions': 3,
}
# Hyperparameters for Pong-v5
AtariPong = {
'n_episodes': 10000,
'observation_stack_size': 4,
'memory_size': 20000,
'batch_size': 32,
'target_update_frequency': 100,
'train_frequency': 4,
'gamma': 0.99,
'lr': 0.00025,
'eps_start': 1.0,
'eps_end': 0.1,
'anneal_length': 10**6,
'n_actions': 3,
}
# Hyperparameters for Breakout-v0
AtariBreakout = {
'n_episodes': 10000,
'observation_stack_size': 4,
'memory_size': 20000,
'batch_size': 32,
'target_update_frequency': 100,
'train_frequency': 4,
'gamma': 0.99,
'lr': 0.00025,
'eps_start': 1.0,
'eps_end': 0.1,
'anneal_length': 10**6,
'n_actions': 3,
}