Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor optimizer initialization #8607

Merged
merged 4 commits into from
Jul 17, 2022
Merged

Refactor optimizer initialization #8607

merged 4 commits into from
Jul 17, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 17, 2022

smart_optimizert() function now handles optimizer creation with smart bn and bias handling to avoid weight decay.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Simplification of optimizer configuration in YOLOv5 training script.

πŸ“Š Key Changes

  • Removed specific optimizer configurations directly from train.py.
  • Introduced smart_optimizer function in utils/torch_utils.py.
  • The smart_optimizer function handles optimizer creation, consolidating parameter groups and optimizer setup.
  • Support for RMSprop optimizer has been added.

🎯 Purpose & Impact

  • Purpose:
    • Clean up the train.py script by removing redundant optimizer setup code.
    • Centralize the optimizer creation to improve maintainability and extend functionality.
  • Impact:
    • Users can easily configure and switch between different optimizers, leading to potential improvements in training efficiency.
    • Provides a more streamlined and adaptable codebase for future updates or customizations.πŸ› 

@glenn-jocher glenn-jocher self-assigned this Jul 17, 2022
@glenn-jocher glenn-jocher merged commit 51fb467 into master Jul 17, 2022
@glenn-jocher glenn-jocher deleted the update/optimizer branch July 17, 2022 09:43
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Refactor optimizer initialization

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update train.py

* Update train.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

None yet

1 participant