Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tf): make se_atten_v2 masking smooth when davg is not zero #3632

Merged
merged 9 commits into from
Apr 2, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Apr 1, 2024

Currently, se_atten_v2 is always masked to zero when exclude_types is given. However, for the no neighbor case, the placeholder for a virtual neighbor is davg. This causes discontinuity when set_davg_zero is not set.

This PR uses davg for masking.

In production, we usually use set_davg_zero along with exclude_types, so it hasn't caused a real problem.

I notice PT hasn't implemented se_atten_v2 or exclude_types, but we need attention in the future.

@njzjz njzjz requested review from iProzd and wanghan-iapcm April 1, 2024 18:32
@github-actions github-actions bot added the Python label Apr 1, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.77%. Comparing base (15e4926) to head (df1f4fb).
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3632      +/-   ##
==========================================
- Coverage   77.79%   77.77%   -0.02%     
==========================================
  Files         438      438              
  Lines       37693    37709      +16     
  Branches     1623     1623              
==========================================
+ Hits        29322    29329       +7     
- Misses       7507     7516       +9     
  Partials      864      864              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iProzd iProzd added this pull request to the merge queue Apr 2, 2024
Merged via the queue into deepmodeling:devel with commit 63601b0 Apr 2, 2024
48 checks passed
@njzjz njzjz added this to the v2.2.10 milestone Apr 6, 2024
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Apr 6, 2024
…pmodeling#3632)

Currently, `se_atten_v2` is always masked to zero when `exclude_types`
is given. However, for the no neighbor case, the placeholder for a
virtual neighbor is `davg`. This causes discontinuity when
`set_davg_zero` is not set.

This PR uses `davg` for masking.

In production, we usually use `set_davg_zero` along with
`exclude_types`, so it hasn't caused a real problem.

I notice PT hasn't implemented `se_atten_v2` or `exclude_types`, but we
need attention in the future.

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 63601b0)
@njzjz njzjz mentioned this pull request Apr 6, 2024
njzjz added a commit that referenced this pull request Apr 6, 2024
Currently, `se_atten_v2` is always masked to zero when `exclude_types`
is given. However, for the no neighbor case, the placeholder for a
virtual neighbor is `davg`. This causes discontinuity when
`set_davg_zero` is not set.

This PR uses `davg` for masking.

In production, we usually use `set_davg_zero` along with
`exclude_types`, so it hasn't caused a real problem.

I notice PT hasn't implemented `se_atten_v2` or `exclude_types`, but we
need attention in the future.

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 63601b0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants