Repository navigation
Fix empty missing-label losses and valid-energy MAE weighting - #255
Open
davrens101 wants to merge 2 commits into
Open
davrens101 wants to merge 2 commits into
davrens101 wants to merge 2 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 12 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
allow_missing_labels=True,CombinedLossmasks NaN energy/force/stress labels, but still mean-reduces an empty tensor when a whole batch lacks one target. That produces NaN loss and MAE. A realTrainer.trainrun exits withExit due to NaNwhen its first batch has no energy label, even when force labels are available. A zero metric count alone does not help:AverageMeterstill accumulatesNaN * 0.Energy MAE also uses the original batch size instead of the number of valid energies. For batches with errors
[2, missing]and[4, 6], this reports 3.5 rather than the valid-label mean 4.0.Changes
allow_missing_labels=Falsebehavior.Verification
CPU, Python 3.12, PyTorch 2.15.0+cpu:
tests/test_trainer.py: 18 passed (including existing training/checkpoint/W&B tests; W&B offline).No GPU validation is claimed. Investigation, implementation and verification were AI-assisted.