Skip to content

feat: Implement adaptive learning rate scheduling#9

Open
Anroshka wants to merge 1 commit intomainfrom
feat/adaptive-lr
Open

feat: Implement adaptive learning rate scheduling#9
Anroshka wants to merge 1 commit intomainfrom
feat/adaptive-lr

Conversation

@Anroshka
Copy link
Copy Markdown
Owner

@Anroshka Anroshka commented Jun 10, 2025

I've added an adaptive learning rate scheduler (ReduceLROnPlateau) to the QLearningAgent. This scheduler monitors the average score and reduces the learning rate if the score plateaus, potentially leading to improved training stability and performance.

Changes include:

  • Modified QLearningAgent in model.py to initialize and step the ReduceLROnPlateau scheduler.
  • Updated MultiAgentDQN in model.py to propagate the scheduler step to all individual agents.
  • Modified the training loop in train_multi.py to call the scheduler step at the end of each episode using the average score.
  • Updated save_model and load_model in QLearningAgent to save and load the scheduler's state, ensuring continuity in training and backward compatibility with older model files.

Description

Please include a summary of the changes and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

I've added an adaptive learning rate scheduler (`ReduceLROnPlateau`) to the
QLearningAgent. This scheduler monitors the average score and reduces the
learning rate if the score plateaus, potentially leading to improved
training stability and performance.

Changes include:
- Modified `QLearningAgent` in `model.py` to initialize and step the
  `ReduceLROnPlateau` scheduler.
- Updated `MultiAgentDQN` in `model.py` to propagate the scheduler step
  to all individual agents.
- Modified the training loop in `train_multi.py` to call the scheduler
  step at the end of each episode using the average score.
- Updated `save_model` and `load_model` in `QLearningAgent` to save
  and load the scheduler's state, ensuring continuity in training
  and backward compatibility with older model files.
@deepsource-io
Copy link
Copy Markdown
Contributor

deepsource-io bot commented Jun 10, 2025

Here's the code health analysis summary for commits 34c3480..07903b7. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 4 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant