deepmodeling / deepmodeling/LAMBench
[Code scan] Constant stacking-fault predictions can produce invalid derivative metrics
- Dominant language
- Python
- Stars
- 20
- Forks
- 11
- Avg merge
- 30m
- Merged PRs (30d)
- 4
Description
This issue was found by a Codex global repository scan of tracked non-test files at commit `8c93925cb10b401b2b83c738bd9263fd74474468`.
### Relevant code
https://github.com/deepmodeling/LAMBench/blob/8c93925cb10b401b2b83c738bd9263fd74474468/lambench/tasks/calculator/stacking_fault/stacking_fault.py#L34-L49
### Impact
The derivative metric normalizes by `max(y_smooth_pred)`. A calculator that predicts a flat energy curve produces `y_smooth_pred == 0` after subtracting the minimum, so the denominator is zero. The resulting `NaN` values can make the derivative MAE invalid or fail the task instead of assigning a defined penalty for a bad trajectory.
### Suggested fix
Guard zero or near-zero denominators and assign a defined derivative penalty, or mark that trajectory as failed while allowing the rest of the task to complete. Add a regression test with constant predicted energies.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with lambench/tasks/calculator/stacking_fault/stacking_fault.py, especially lines 34-49, and trace how the derivative metric normalizes the smoothed prediction. Add a regression test using constant predicted energies, then verify the derivative metric remains defined and the task completes or records the trajectory failure without invalid NaN results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100