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 model EMA (Exponential Moving Average) #114

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

sokovninn
Copy link
Member

This pull request introduces a new Exponential Moving Average (EMA) callback for model training, along with its integration and corresponding unit tests. The main changes include the addition of the EMACallback class, its registration, and tests to ensure its functionality.

New EMA Callback

  • luxonis_train/callbacks/ema.py: Added the EMACallback class, which includes methods for initializing the EMA, updating EMA weights, and handling checkpoint saving/loading. This class helps in maintaining a moving average of model parameters to potentially improve model performance.

Integration

Unit Tests

@sokovninn sokovninn requested a review from a team as a code owner October 13, 2024 13:36
@sokovninn sokovninn requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team October 13, 2024 13:36
@github-actions github-actions bot added enhancement New feature or request release New version release labels Oct 13, 2024
@sokovninn sokovninn changed the title Add EMA (Exponential Moving Average) Add model EMA (Exponential Moving Average) Oct 13, 2024
Copy link
Contributor

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, let's also add it do the docs (callback README)

luxonis_train/callbacks/ema.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 93.84615% with 8 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@fb5f1aa). Learn more about missing BASE report.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
luxonis_train/callbacks/ema.py 89.18% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #114   +/-   ##
=======================================
  Coverage        ?   97.06%           
=======================================
  Files           ?      141           
  Lines           ?     6133           
  Branches        ?        0           
=======================================
  Hits            ?     5953           
  Misses          ?      180           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kozlov721 kozlov721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release New version release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants