-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameters.py
More file actions
executable file
·56 lines (41 loc) · 2.19 KB
/
parameters.py
File metadata and controls
executable file
·56 lines (41 loc) · 2.19 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
class Parameters():
def __init__(self, env, args):
# MODEL HYPERPARAMETERS
# Our input is a stack of 4 frames hence 110x84x4 (Width, height, channels)
self.state_size = [110, 84, 4]
self.nb_states = 110 * 84 * 4
self.nb_actions = env.action_space.n # 8 possible actions
self.learning_rate = 0.00025 # Alpha (aka learning rate)
# TRAINING HYPERPARAMETERS
self.total_episodes = 500 # Total episodes for training
self.max_steps = 50000 # Max possible steps in an episode
self.batch_size = 64 # Batch size
# Exploration parameters for epsilon greedy strategy
self.explore_start = 1.0 # exploration probability at start
self.explore_stop = 0.1 # minimum exploration probability
self.decay_rate = 0.000003 # exponential decay rate for exploration prob
# Q learning hyperparameters
self.gamma = 0.9 # Discounting rate
# MEMORY HYPERPARAMETERS
# Number of experiences stored in the Memory when initialized for the first time
self.pretrain_length = self.batch_size
self.memory_size = 20000 # Number of experiences the Memory can keep
# PREPROCESSING HYPERPARAMETERS
self.stack_size = 4 # Number of frames stacked
# Fixed Q-target : update the parameter of our target_network every tau
self.tau = 10
training = bool(int(args[1]))
episode_render = bool(int(args[2]))
get_saved_model = bool(int(args[3]))
simple_dqn = bool(int(args[4]))
# training = True
# episode_render = False
# get_saved_model = False
# simple_dqn = True
# MODIFY THIS TO FALSE IF YOU JUST WANT TO SEE THE TRAINED AGENT
self.training = training
# TURN THIS TO TRUE IF YOU WANT TO RENDER THE ENVIRONMENT
self.episode_render = episode_render
# GET SAVED MODEL (FALSE FOR STARTING WITH NEW FRESH MODELS)
self.get_saved_model = get_saved_model
self.simple_dqn = simple_dqn