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

Add ComputeLoss() class #1950

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Add ComputeLoss() class #1950

merged 1 commit into from
Jan 15, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jan 15, 2021

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refactoring of loss computation to enhance modularity and scalability in YOLOv5.

πŸ“Š Key Changes

  • Removed the global compute_loss function and replaced it with a ComputeLoss class.
  • The ComputeLoss class now takes care of calculating the loss and is instantiated in train.py.
  • Adjusted calls to compute loss in both train.py and test.py to use the new class.

🎯 Purpose & Impact

  • πŸ› οΈ Modularity: Encapsulating the loss function in a class improves code organization, making it easier to manage and understand.
  • πŸ“ˆ Scalability: The change prepares the codebase for potentially more complex loss computations and further development.
  • πŸš€ User Experience: Users now have a clear interface for loss computation, which may aid in custom modifications or extensions.

@glenn-jocher glenn-jocher merged commit ca9babb into master Jan 15, 2021
@glenn-jocher glenn-jocher deleted the autobalance branch January 15, 2021 21:50
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
taicaile pushed a commit to taicaile/yolov5 that referenced this pull request Oct 12, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
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