-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameters_backup.py
More file actions
72 lines (61 loc) · 2.74 KB
/
Copy pathparameters_backup.py
File metadata and controls
72 lines (61 loc) · 2.74 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
"""
All the much needed hyper-parameters needed for the algorithm implementation.
"""
MODEL_LOAD = False
SEED = 0
BATCH_SIZE = 1
IM_WIDTH = 160
IM_HEIGHT = 80
GAMMA = 0.99
MEMORY_SIZE = 5000
EPISODES = 1000
#VAE Bottleneck
LATENT_DIM = 95
#Dueling DQN (hyper)parameters
DQN_LEARNING_RATE = 0.0001
EPSILON = 1.00
EPSILON_END = 0.05
EPSILON_DECREMENT = 0.00001
REPLACE_NETWORK = 5
DQN_CHECKPOINT_DIR = 'preTrained_models/ddqn'
MODEL_ONLINE = 'carla_dueling_dqn_online.pth'
MODEL_TARGET = 'carla_dueling_dqn_target.pth'
TOWN7 = "Town07"
#Proximal Policy Optization (hyper)parameters - OPTIMIZED FOR LEARNING
EPISODE_LENGTH = 20000 # Shorter episodes for faster learning cycles
TOTAL_TIMESTEPS = 6e6 # Increased for longer training to reach 90% accuracy
ACTION_STD_INIT = 0.4 # Increased for better exploration initially
TEST_TIMESTEPS = 5e4
PPO_LEARNING_RATE = 3e-4 # Increased for faster learning (was too conservative)
PPO_CHECKPOINT_DIR = 'preTrained_models/ppo/'
POLICY_CLIP = 0.2 # Standard PPO clip ratio (was too conservative)
# Environment / termination tuning
EARLY_STOP_TIMEOUT = 800 # Reduced timeout for faster episode cycling
END_ON_COLLISION = True
TURN_BONUS = 0.8 # Increased from 0.2 for better turning rewards
WALLCLOCK_TIMEOUT = None
# ===== FULL MAP TRAINING MODE =====
FULL_MAP_MODE = False # Set to True for continuous full-map episodes (car runs until collision)
FULL_MAP_EPISODE_LENGTH = 50000 # Much longer episodes for full map exploration (only used if FULL_MAP_MODE=True)
FULL_MAP_EARLY_STOP_TIMEOUT = 1800 # 30 minutes timeout for stuck vehicles in full map mode
# Additional PPO parameters for better learning
PPO_BATCH_SIZE = 64 # Batch size for updates
PPO_EPOCHS = 10 # Number of epochs per update
PPO_ENTROPY_COEF = 0.01 # Entropy coefficient for exploration
PPO_VALUE_COEF = 0.5 # Value function loss coefficient
PPO_MAX_GRAD_NORM = 0.5 # Gradient clipping norm
# Curriculum learning toggle
CURRICULUM_ENABLED = True
# ===== Advanced PPO & Observation Enhancements =====
# Generalized Advantage Estimation parameter (lambda)
GAE_LAMBDA = 0.95
# Number of optimization epochs per PPO update (override if needed)
PPO_MINIBATCH_EPOCHS = 10
# Mini-batch size for PPO updates
PPO_MINIBATCH_SIZE = 256 # Reduced for gradient stability
# Number of environment steps collected before each PPO update
PPO_ROLLOUT_STEPS = 4096
# Multi-waypoint observation settings
NUM_WAYPOINTS = 5 # Number of future waypoints to include in observation
WAYPOINT_DISTANCE = 4.0 # Distance (meters) between successive future waypoints
USE_WAYPOINT_AUG = False # Toggle to enable/disable future waypoint augmentation (set False for stability/reverting)