aimnet2 updates; additional loss options; multi cutoff neighborlists#361
aimnet2 updates; additional loss options; multi cutoff neighborlists#361chrisiacovella merged 29 commits intochoderalab:mainfrom
Conversation
…s. Also changing naming to reflect quantity type...i.e., electrostatic_energy is now per_system_electrostatic_energy
…now return per_atom_charge predictions/targets. Dipole moment is also separated from total_charge function (since we can do dipole moment loss independent of total_charge loss).
…restructuring to work with torchscript
…re the other pairlistdata instances for each cutoff
|
I'll note this is still partially a WIP. I still need to implement some CI tests for the multi-cutoff neighbor lists and add in the DFTD3 post-processing routine (although I might end up skipping that for this PR and do that in a separate one). |
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR integrates per-atom partial charge support, extends loss functions to include charge errors, and refactors neighborlist routines to support multiple cutoffs alongside adding DFTD3-based dispersion and energy‐summation postprocessing.
Key changes:
- Added partial_charge flow through PropertyNames, Metadata, BatchData, training, and Loss.
- Refactored
NeighborListFor*to returnPairlistOutputswithlocal,vdw, andelectrostaticcutoffs. - Introduced
DispersionPotential,SumPerSystemEnergies, and updatedPostProcessingfor new per-system energy terms.
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modelforge/utils/prop.py | Added partial_charge to PropertyNames and Metadata. |
| modelforge/train/training.py | Updated CalculateProperties to handle per-atom and total charges; renamed helper methods. |
| modelforge/train/losses.py | Added PerAtomChargeError and updated Loss to include per_atom_charge. |
| modelforge/potential/processing.py | Added SumPerSystemEnergies, DispersionPotential, and multi-cutoff postprocessing; contains a key‐naming bug. |
| modelforge/potential/neighbors.py | Refactored neighborlist classes to return PairlistOutputs; updated internal logic for multiple cutoffs. |
| modelforge/tests | Updated tests for .local_cutoff API and added test_per_atom_charge_loss. |
Comments suppressed due to low confidence (2)
modelforge/potential/processing.py:435
- The key
electrostatic_r_ij]contains an extra bracket and won't match downstream usage (electrostatic_r_ij). Remove the trailing]inside the string.
Returns
modelforge/potential/processing.py:336
- The
forwardmethod inSumPerSystemEnergiesis defined inside__init__, making it a local function rather than a class method. Movedef forward(...)out of__init__and indent it at the class level.
def forward(self, data: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor]:
…repo; but also needed to update fe_ii.toml
Pull Request Summary
The PR is primarily focused on getting all the odds and ends together for proper utilization of aimnet2.
The changes are outlined below:
Key changes
Notable points that this PR has either accomplished or will accomplish.
Associated Issue(s)
Pull Request Checklist