Skip to content

Commit

Permalink
Chore: remove grad from nlist linear model (#4380)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
	- Improved gradient tracking capabilities during model forward passes.
- Enhanced weight computation for atomic models, allowing for better
handling of neighbor list sizes and transitions.

- **Bug Fixes**
	- Resolved issues with weight calculations based on atom distances.
- Added error handling to ensure proper boundaries in weight
computations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
anyangml and pre-commit-ci[bot] authored Nov 19, 2024
1 parent db2bc94 commit 6039e0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/pt/model/atomic_model/linear_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,12 @@ def forward_atomic(
extended_coord = extended_coord.view(nframes, -1, 3)
sorted_rcuts, sorted_sels = self._sort_rcuts_sels()
nlists = build_multiple_neighbor_list(
extended_coord,
extended_coord.detach(),
nlist,
sorted_rcuts,
sorted_sels,
)

raw_nlists = [
nlists[get_multiple_nlist_key(rcut, sel)]
for rcut, sel in zip(self.get_model_rcuts(), self.get_model_nsels())
Expand Down

0 comments on commit 6039e0b

Please sign in to comment.