pyt-team / TopoModelX

Topological Deep Learning
MIT License
219 stars 79 forks source link

Hypergraph checks #249

Closed levtelyatnikov closed 10 months ago

levtelyatnikov commented 10 months ago

Overall: I have reviewed the hypergraph implementation and made necessary modifications to ensure consistent patterns. Additionally, I have updated tutorials and test files to align with these changes.

Specifically: Previously, all the models generated the 'desired' hidden representation, meaning that if a model was required to perform a graph classification task, the pooling operation was executed within the model. Hence, the model output was the pooled signal.

y_pred = model(x_0_init, incidence)

Now, the models output the last hidden representations. In hypergraph models, the output includes nodes and hyperedges.

x_0, x_1 = model(x_0_init, incidence)

We have introduced a separate, lightweight pooling/readout class that is responsible for providing the desired output for particular downstream tasks. This new pooling/readout class is currently introduced in the tutorials.

pooling = readout(task_level="graph")
x_0, x_1 = model(x_0_init, incidence)
y_pred = pooling(x_0, x_1)
review-notebook-app[bot] commented 10 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e160cb8) 97.49% compared to head (62513dc) 97.45%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #249 +/- ## ========================================== - Coverage 97.49% 97.45% -0.05% ========================================== Files 58 57 -1 Lines 2155 2121 -34 ========================================== - Hits 2101 2067 -34 Misses 54 54 ``` | [Files](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team) | Coverage Δ | | |---|---|---| | [topomodelx/nn/hypergraph/allset.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2FsbHNldC5weQ==) | `100.00% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/allset\_layer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2FsbHNldF9sYXllci5weQ==) | `88.88% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/allset\_transformer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2FsbHNldF90cmFuc2Zvcm1lci5weQ==) | `100.00% <100.00%> (ø)` | | | [...pomodelx/nn/hypergraph/allset\_transformer\_layer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2FsbHNldF90cmFuc2Zvcm1lcl9sYXllci5weQ==) | `94.33% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/dhgcn.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2RoZ2NuLnB5) | `100.00% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/dhgcn\_layer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2RoZ2NuX2xheWVyLnB5) | `95.38% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/hmpnn.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2htcG5uLnB5) | `100.00% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/hmpnn\_layer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2htcG5uX2xheWVyLnB5) | `100.00% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/hnhn.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2huaG4ucHk=) | `100.00% <100.00%> (ø)` | | | [topomodelx/nn/hypergraph/hnhn\_layer.py](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team#diff-dG9wb21vZGVseC9ubi9oeXBlcmdyYXBoL2huaG5fbGF5ZXIucHk=) | `96.82% <100.00%> (-0.10%)` | :arrow_down: | | ... and [12 more](https://app.codecov.io/gh/pyt-team/TopoModelX/pull/249?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyt-team) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.