Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agents/ppo_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def __init__(self, config, device):

# Add learning rate scheduler for linear decay with minimum LR
num_updates = config.total_timesteps // (config.n_steps * config.n_envs)
# Ensure at least one update to avoid division by zero
num_updates = max(num_updates, 1)
min_lr_ratio = 0.1 # Don't let LR go below 10% of initial
lr_lambda = lambda update: max(min_lr_ratio, 1.0 - (update / num_updates))
self.scheduler = torch.optim.lr_scheduler.LambdaLR(self.optimizer, lr_lambda=lr_lambda)
Expand Down