Message Passing Module#516
Conversation
Code Coverage SummaryResults 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.
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.
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_integerinpina/utils.pyand adds tests intests/test_utils.py. - Expands the test suite under
tests/test_messagepassingto 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
dario-coscia
left a comment
There was a problem hiding this comment.
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
|
@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. |
dario-coscia
left a comment
There was a problem hiding this comment.
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 <dariocos99@gmail.com>
c7bf7d9 to
fbc0382
Compare
* Fix adaptive refinement (#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * 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 <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#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 <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#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 <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#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 <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
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