feat: Implement XAS (X-ray Absorption Spectroscopy) model, fitting, l…#5337
feat: Implement XAS (X-ray Absorption Spectroscopy) model, fitting, l…#5337anyangml wants to merge 9 commits intodeepmodeling:masterfrom
Conversation
…oss, and testing infrastructure.
for more information, see https://pre-commit.ci
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for an XAS (X-ray Absorption Spectroscopy) fitting/model/loss pipeline, including configuration schema updates and new PyTorch + “dpmodel” implementations.
Changes:
- Register new
xasfitting-net arguments and XAS loss arguments inargcheck. - Introduce XAS fitting/task, atomic model, and model wrappers for both PyTorch and
dpmodel. - Add an
XASLossand wire it into the PyTorch training loss factory.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| deepmd/utils/argcheck.py | Adds xas fitting and loss arg schemas; introduces absorbing_type model arg. |
| deepmd/pt/train/training.py | Wires XASLoss and makes fully_shard import optional. |
| deepmd/pt/model/task/xas.py | Adds PyTorch XAS fitting net implementation and (de)serialization. |
| deepmd/pt/model/task/init.py | Exposes XASFittingNet. |
| deepmd/pt/model/model/xas_model.py | Adds PyTorch XASModel wrapper with translated outputs. |
| deepmd/pt/model/model/init.py | Routes fitting_net_type=="xas" to XASModel and passes absorbing_type. |
| deepmd/pt/model/atomic_model/xas_atomic_model.py | Adds PyTorch atomic model to exclude non-absorbing types automatically. |
| deepmd/pt/model/atomic_model/init.py | Exposes DPXASAtomicModel (PyTorch). |
| deepmd/pt/loss/xas.py | Introduces XASLoss with optional CDF auxiliary term. |
| deepmd/pt/loss/init.py | Exposes XASLoss. |
| deepmd/dpmodel/model/xas_model.py | Adds dpmodel XASModel wrapper with translated outputs. |
| deepmd/dpmodel/model/model.py | Routes fitting_net_type=="xas" to dpmodel XASModel and passes absorbing_type. |
| deepmd/dpmodel/fitting/xas_fitting.py | Adds dpmodel XAS fitting net implementation. |
| deepmd/dpmodel/fitting/init.py | Exposes XASFittingNet (dpmodel). |
| deepmd/dpmodel/atomic_model/xas_atomic_model.py | Adds dpmodel atomic model with absorbing-type masking + (de)serialization. |
| deepmd/dpmodel/atomic_model/init.py | Exposes DPXASAtomicModel (dpmodel). |
| deepmd/about.py | Adds a dev stub __version__. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5337 +/- ##
==========================================
- Coverage 82.42% 82.16% -0.27%
==========================================
Files 784 800 +16
Lines 79125 82274 +3149
Branches 3676 4004 +328
==========================================
+ Hits 65220 67599 +2379
- Misses 12732 13467 +735
- Partials 1173 1208 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…revious XAS model components and adding new tests.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
… introduce a dedicated XAS model.
for more information, see https://pre-commit.ci
…oss, and testing infrastructure.