Skip to content

Refactor optimizer initialization#8607

Merged
glenn-jocher merged 4 commits intomasterfrom
update/optimizer
Jul 17, 2022
Merged

Refactor optimizer initialization#8607
glenn-jocher merged 4 commits intomasterfrom
update/optimizer

Conversation

@glenn-jocher
Copy link
Copy Markdown
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.

1 participant