-
Notifications
You must be signed in to change notification settings - Fork 80
Message Passing Module #516
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
Conversation
Code Coverage Summary
Results for commit: fbc0382 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
b17fd16
to
23b3560
Compare
Hi @AleDinve @GiovanniCanali ! How is it going with this? |
Hi @dario-coscia, I need to fix some minor issues with InteractionNetwork, and then I will fix EGNN. Also, tests will be implemented. @AleDinve agreed to take care of the remaining classes. |
Yes, I confirm, I will have a tentative implementation of the classes assigned to me by the weekend. |
5727bcc
to
426da3e
Compare
f38ccbd
to
1c6bef4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good @GiovanniCanali and @AleDinve ! I made few comments on the implementation of the various blocks.
I think we should think about inserting inside utils.py
a simple function that checks integer types and values. For example (very minimalistic):
def check_values(value, positive=True, strict=True):
if positive and strict:
assert value >= 0
.....
this would reduce a lot of lines of code inside the blocks.
5b7a708
to
1525549
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds implementations of various message-passing neural network blocks, a new utility for validating integer inputs, and corresponding tests.
- Implements five blocks: InteractionNetworkBlock, DeepTensorNetworkBlock, EnEquivariantNetworkBlock, RadialFieldNetworkBlock, SchnetBlock.
- Introduces
check_positive_integer
inpina/utils.py
and adds tests intests/test_utils.py
. - Expands the test suite under
tests/test_messagepassing
to cover constructor, forward, and backward behavior for each block.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
File | Description |
---|---|
tests/test_utils.py | Reorganized imports; added test_check_positive_integer . |
tests/test_messagepassing/test_schnet_block.py | Added constructor, forward, and backward tests for SchnetBlock . |
tests/test_messagepassing/test_radial_field_network_block.py | Added constructor, forward, and backward tests for RadialFieldNetworkBlock . |
tests/test_messagepassing/test_interaction_network_block.py | Added constructor, forward, and backward tests for InteractionNetworkBlock . |
tests/test_messagepassing/test_equivariant_network_block.py | Added constructor, forward, and backward tests for EnEquivariantNetworkBlock . |
tests/test_messagepassing/test_deep_tensor_network_block.py | Added constructor, forward, and backward tests for DeepTensorNetworkBlock . |
pina/utils.py | Added check_positive_integer utility. |
pina/model/block/message_passing/schnet_block.py | Implemented SchnetBlock . |
pina/model/block/message_passing/radial_field_network_block.py | Implemented RadialFieldNetworkBlock . |
pina/model/block/message_passing/interaction_network_block.py | Implemented InteractionNetworkBlock . |
pina/model/block/message_passing/egnn_block.py | Implemented EnEquivariantNetworkBlock . |
pina/model/block/message_passing/deep_tensor_network_block.py | Implemented DeepTensorNetworkBlock . |
pina/model/block/message_passing/init.py | Updated __all__ to include new blocks. |
4d814a6
to
4110851
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice overall! I think the PR is almost ready.
I left few comments because I find some differences in EGNN and ShNet implementation wrt the paper.
Also I wanted to ask, should we test invariance and Equiv. in tests? I think we should
pina/model/block/message_passing/en_equivariant_network_block.py
Outdated
Show resolved
Hide resolved
@dario-coscia loops and hyperlinks have been fixed. There are two last things left:
|
Fixed EGNN and added equivariance test. Ready for final review @dario-coscia. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me everything is great now!
I made a simple fix in EGNN to avoid self.message...
to be more pyg compliant. I also added invariance tests for SchNEt and Equivariance for RBF following what @GiovanniCanali did for EGNN!
❤️
|
a3e7f9f
to
104c639
Compare
383a92a
to
c7bf7d9
Compare
Co-authored-by: Dario Coscia <[email protected]>
c7bf7d9
to
fbc0382
Compare
* Fix adaptive refinement (#571) --------- Co-authored-by: Dario Coscia <[email protected]> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (#581) * Fix tutorial .html link (#580) * fix problem data collection for v0.1 (#584) * Message Passing Module (#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <[email protected]> --------- Co-authored-by: giovanni <[email protected]> Co-authored-by: AleDinve <[email protected]> * add type checker (#527) --------- Co-authored-by: Filippo Olivo <[email protected]> Co-authored-by: Giovanni Canali <[email protected]> Co-authored-by: giovanni <[email protected]> Co-authored-by: AleDinve <[email protected]>
Description
This PR fixes #515.
Here a tentative RoadMap
InteractionNetworkBlock
: implements the interaction network (See sec.2 of https://arxiv.org/pdf/1704.01212)DeepTensorNetworkBlock
: implements the Deep Tensor Neural Networks block (See sec.2 of https://arxiv.org/pdf/1704.01212)EGNNBlock
: implements the E(n) Equivariant Graph Neural Network block(See sec.3 of https://arxiv.org/pdf/2102.09844)RadialFieldBlock
: implements the radial field network block (See Tab1. of https://arxiv.org/pdf/2102.09844)SchnetBlock
: implements the schnet block (See Tab1. of https://arxiv.org/pdf/2102.09844)Checklist