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

Improve distance cutoff in DimeNet #4562

Merged
merged 4 commits into from
Apr 29, 2022
Merged

Conversation

danielzuegner
Copy link
Contributor

Currently (as per my recent PR) the clamping of (dist / cutoff).clamp_max(1.0) is done outside the envelope. However, this means that we need to repeat this for each place using the envelope (e.g., the SphericalBasisLayer). The clean way to do it is to have the masking inside the envelope; this is also how it's implemented in DimeNet.

danielzuegner and others added 3 commits April 29, 2022 10:38
This is cleaner than (dist / cutoff).clamp_max(1.0) because it's the envelope that should become zero and then effectively mask distances larger than the cutoff. This is also how it's implemented in [`DimeNet`](https://github.com/gasteigerjo/dimenet/blob/09123a0e16e728d0a0e53e6686b04f859802aa81/dimenet/model/layers/envelope.py#L23).
torch_geometric/nn/models/dimenet.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #4562 (133e195) into master (e220a2c) will decrease coverage by 0.11%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #4562      +/-   ##
==========================================
- Coverage   82.83%   82.71%   -0.12%     
==========================================
  Files         313      313              
  Lines       16363    16361       -2     
==========================================
- Hits        13554    13533      -21     
- Misses       2809     2828      +19     
Impacted Files Coverage Δ
torch_geometric/nn/models/dimenet.py 17.66% <0.00%> (ø)
torch_geometric/nn/conv/utils/typing.py 81.25% <0.00%> (-17.50%) ⬇️
torch_geometric/io/tu.py 93.58% <0.00%> (-2.57%) ⬇️
torch_geometric/nn/models/mlp.py 98.41% <0.00%> (-1.59%) ⬇️
torch_geometric/transforms/gdc.py 78.17% <0.00%> (-1.02%) ⬇️
torch_geometric/data/dataset.py 96.80% <0.00%> (-0.80%) ⬇️
torch_geometric/nn/conv/rgat_conv.py 83.76% <0.00%> (-0.53%) ⬇️
torch_geometric/graphgym/utils/comp_budget.py 15.51% <0.00%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e220a2c...133e195. Read the comment docs.

@rusty1s rusty1s merged commit 85fc32e into pyg-team:master Apr 29, 2022
@rusty1s
Copy link
Member

rusty1s commented Apr 29, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants