-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
116 lines (91 loc) · 2.13 KB
/
settings.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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
## Simulation
PATH_TO_MAIN_CARLA_FOLDER = "lib/Carla"
CONNECTION_IP = "localhost"
CONNECTION_PORT = 2000
SIM_QUALITY = "Low" # Low / Epic
NUM_OF_AGENTS = 4
PREVIEW_AGENTS = True
FPS_COMPENSATION = 20.0
LOG_EVERY = 10
# End thresholds
ROTATION_THRESHOLD = 75
COLLISION_FILTER = [['static.sidewalk', -1], ['static.road', -1], ['vehicle.', 80]]
SECONDS_PER_EXPISODE = 30.0
# Valid episode criteria
MINIMUM_EPISODE_LENGTH = 4.0
# Reward Settings
EPISODE_REWARD_MULTIPLIER = 100
BAD_ROTATION_REWARD = -1.0
COLLISION_REWARD = -1.0
SPEED_MIN_REWARD = -0.007
SPEED_MAX_REWARD = 0.005
TIME_WEIGHTED_REWARDS = False
# Trafic settings
VEHICLES_TO_KEEP = 30
TRAFIC_WAIT_LOOP_TIME = 10
##end
## Agent settings
STEER_AM = 1.0
THROT_AM = 1.0
BRAKE_AM = 0.8
# Camera settings
PREVIEW_CAMERA_IMAGE_DIMENSIONS = (540, 480, 3)
PREVIEW_CAMERA_FOV = 90
CAMERA_IMAGE_DIMENSIONS = (480, 270, 1)
CAMERA_FOV = 130
##end
## Training settings
START_TENSORBOARD_ON_TRAINING = True
MIN_FPS_FOR_TRAINING = 5
# Model save settings
MIN_SCORE_TO_SAVE = -200
MIN_SCORE_DIF = 10
MAX_EPSILON_TO_SAVE = 0.3
CHECKPOINT_EVERY = 50
MODEL_SAVE_PATH = "models"
CHECKPOINT_SAVE_PATH = "checkpoint"
DEFAULT_ACTION = 7
ACTIONS = {
0: [0.7, -1.0, 0.0],
1: [1.0, 0.0, 0.0],
2: [0.7, 1.0, 0.0],
3: [0.0, -1.0, 0.0],
4: [0.0, 0.0, 0.0],
5: [0.0, 1.0, 0.0],
6: [0.0, -1.0, 1.0],
7: [0.0, 0.0, 1.0],
8: [0.0, 1.0, 1.0]
}
# Num of episodes to train for / None - infinite
EPISODES = None
UPDATE_TARGET_EVERY = 100
TRAINING_EPOCHS = 1
# Batches
MINIBATCH_SIZE = 16
PREDICTION_BATCH_SIZE = 1
TRAINING_BATCH_SIZE = MINIBATCH_SIZE // 4
# Model settings
MODEL_NAME = "CNN_3_base" # CNN_5_residual
WEIGHT_PATH = None
TARGET_WEIGHTS_PATH = None
FEED_LAST_ACTION_INPUT = True
FEED_SPEED_INPUT = True
HIDDEN_LAYERS = {
"hidden_dense_1": 256
}
# Optimizer settings
OPTIMIZER = "adam" # sgd, adam, adadelta
OPTIMIZER_LEARNING_RATE = 0.001
OPTIMIZER_DECAY = 0
SGD_MOMENTUM = 0.2
# DQN Settings
DISCOUNT = 0.99
REPLAY_MEMORY_SIZE = 15_000
MIN_REPLAY_MEMORY_SIZE = 5_000
# Random rate settings
START_EPSILON = 0.9
EPSILON_DECAY = 0.99997 # 0.99995, 0.99985
MIN_EPSILON = 0.1
##end
# Mic
RANDOM_SEED = 12586