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

Hypergraph Heat Kernel Lift (Hypergraph to Simplicial) (icml2024-58) #140

Draft
wants to merge 59 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0863fc4
Add initial redesign of liftings maps
luisfpereira Nov 25, 2024
e5ee0f3
Rename Complex and move propagate_values to projection sum feature li…
luisfpereira Dec 6, 2024
55b4120
Rename adapters
luisfpereira Dec 6, 2024
8c146f2
Move Complex and adapters to data utils
luisfpereira Dec 6, 2024
59051c6
Update imports
luisfpereira Dec 25, 2024
f05aac4
Merge branch 'main' into lifting-map
luisfpereira Dec 25, 2024
e4165d8
Update SimplicialKHopLifting to work with new design
luisfpereira Jan 15, 2025
2777f9b
Add IdentityAdapter as default for all the adaptations in the Lifting…
luisfpereira Jan 15, 2025
e5d48d3
Improve TnxComplex2Complex api and signatures; improve variable naming
luisfpereira Jan 15, 2025
601a0e1
Update graph2hypergraph liftings to work with new design
luisfpereira Jan 15, 2025
1f9b12d
Update graph2cell liftings to work with new design
luisfpereira Jan 15, 2025
f560475
Improve SimplicialCliqueLifting docstrings
luisfpereira Jan 15, 2025
cfd7f45
Fix lifting tests (NB: same behavior, only adapted setup - with few e…
luisfpereira Jan 15, 2025
5ac166f
Remove dead code
luisfpereira Jan 15, 2025
305f486
Update TRANSFORMS automatically dict creation/imports
luisfpereira Jan 16, 2025
f77ad64
Fix handling of empty matrices due to inexisting dimension
luisfpereira Jan 16, 2025
0668f97
Update feature liftings due to new design
luisfpereira Jan 16, 2025
190e2b8
Add str-based instantiation to LiftingMap for backwards compatibility
luisfpereira Jan 16, 2025
f774c97
Fix Data2NxGraph adapter
luisfpereira Jan 16, 2025
bd24387
Fix failing data manipulation test (only setup)
luisfpereira Jan 16, 2025
a7a8755
Fix TnxComplex2Complex adapter to handle CellComplex features
luisfpereira Jan 16, 2025
2ccbea3
Add syntax sugar to instantiate graph2complex/simplicial lifting tran…
luisfpereira Jan 16, 2025
7682fef
Make imports shorter and use newly added syntax sugar
luisfpereira Jan 16, 2025
f3e3f88
Update domain to accomodate hypergraph data
luisfpereira Jan 16, 2025
f4010fa
Update data_transform to handle new liftings design
luisfpereira Jan 16, 2025
27962fc
Fix failing tests
luisfpereira Jan 16, 2025
1f5ad56
Fix tutorial_lifting
luisfpereira Jan 17, 2025
81df9ac
Remove use of lambda func
luisfpereira Jan 17, 2025
7e7a49b
Merge branch 'main' into lifting-map
luisfpereira Jan 21, 2025
4f10f7b
Bump codecov to v5
luisfpereira Jan 22, 2025
203676e
Improve naming and docstrings; remove leftovers; remove redundant/unn…
luisfpereira Jan 23, 2025
fd9e731
Allow for data2domain to be passed to Graph2ComplexLiftingTransform
luisfpereira Jan 23, 2025
c83a584
Simplify Data2GraphAdapter
luisfpereira Jan 24, 2025
5a1404e
Add ComposedLiftingMap
luisfpereira Jan 28, 2025
081e137
Add graph2graph lifting folder
luisfpereira Jan 28, 2025
ca33b81
Add hypergraph2simplicial folder
luisfpereira Jan 28, 2025
d78cc2d
basic abstract class structure
peekxc Jul 10, 2024
2745eb9
Adding to data transform.py
peekxc Jul 10, 2024
9ef3eca
yaml config + basic tests
peekxc Jul 10, 2024
cee7d8a
Add requirements for a working environment
Tanishqbh Jul 10, 2024
37b0e1a
Adding test cases (not working yet)
peekxc Jul 10, 2024
b1a1455
bug fix related to import statement
peekxc Jul 11, 2024
7d89843
adding contact config
peekxc Jul 11, 2024
17964fc
getting closer to actually importing a data set
peekxc Jul 11, 2024
f00af03
config change to reflect new data
peekxc Jul 12, 2024
384b1cf
Loaders update
peekxc Jul 12, 2024
0738775
Lift updates
peekxc Jul 12, 2024
c44142a
dataset config changes
peekxc Jul 12, 2024
031e567
initial version passing tests
peekxc Jul 12, 2024
ce0cf28
linting
peekxc Jul 12, 2024
3a7aec3
Ruff linting fixes
peekxc Jul 12, 2024
b69f740
More ruff linting fixes
peekxc Jul 12, 2024
5143b49
Small bug fix
peekxc Jul 12, 2024
01ff1d5
Expanded test cases
peekxc Jul 13, 2024
9bd5403
Move icml24-pr58 files
luisfpereira Jan 28, 2025
c3fb81a
Refactor HypergraphHeatLifting
luisfpereira Jan 28, 2025
e9a2c47
Add docstrings to HypergraphHeatLifting
luisfpereira Jan 28, 2025
32ca25f
Add hirola to dependencies
luisfpereira Jan 28, 2025
4674a71
Remove unnecessary files from icml2024-pr58
luisfpereira Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
pytest --cov --cov-report=xml:coverage.xml test/

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
transform_type: 'lifting'
transform_name: "HypergraphHeatLifting"
complex_dim: 2
signed: True
feature_lifting: ProjectionSum
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dependencies=[
"topomodelx @ git+https://github.com/pyt-team/TopoModelX.git",
"toponetx @ git+https://github.com/pyt-team/TopoNetX.git",
"lightning==2.4.0",
"hirola",
]

[project.optional-dependencies]
Expand Down
54 changes: 28 additions & 26 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
"""Configuration file for pytest."""

import networkx as nx
import pytest
import torch
import torch_geometric
from topobenchmark.transforms.liftings.graph2simplicial import (
SimplicialCliqueLifting
)
from topobenchmark.transforms.liftings.graph2cell import (
CellCycleLifting

from topobenchmark.transforms.liftings import (
CellCycleLifting,
Graph2CellLiftingTransform,
Graph2SimplicialLiftingTransform,
SimplicialCliqueLifting,
)


@pytest.fixture
def mocker_fixture(mocker):
"""Return pytest mocker, used when one want to use mocker in setup_method.

Parameters
----------
mocker : pytest_mock.plugin.MockerFixture
A pytest mocker.

Returns
-------
pytest_mock.plugin.MockerFixture
Expand All @@ -31,7 +33,7 @@ def mocker_fixture(mocker):
@pytest.fixture
def simple_graph_0():
"""Create a manual graph for testing purposes.

Returns
-------
torch_geometric.data.Data
Expand Down Expand Up @@ -74,10 +76,11 @@ def simple_graph_0():
)
return data


@pytest.fixture
def simple_graph_1():
"""Create a manual graph for testing purposes.

Returns
-------
torch_geometric.data.Data
Expand Down Expand Up @@ -133,43 +136,43 @@ def simple_graph_1():
return data



@pytest.fixture
def sg1_clique_lifted(simple_graph_1):
"""Return a simple graph with a clique lifting.

Parameters
----------
simple_graph_1 : torch_geometric.data.Data
A simple graph data object.

Returns
-------
torch_geometric.data.Data
A simple graph data object with a clique lifting.
"""
lifting_signed = SimplicialCliqueLifting(
complex_dim=3, signed=True
)
lifting_signed = Graph2SimplicialLiftingTransform(
SimplicialCliqueLifting(complex_dim=3), signed=True
)
data = lifting_signed(simple_graph_1)
data.batch_0 = "null"
return data


@pytest.fixture
def sg1_cell_lifted(simple_graph_1):
"""Return a simple graph with a cell lifting.

Parameters
----------
simple_graph_1 : torch_geometric.data.Data
A simple graph data object.

Returns
-------
torch_geometric.data.Data
A simple graph data object with a cell lifting.
"""
lifting = CellCycleLifting()
lifting = Graph2CellLiftingTransform(CellCycleLifting())
data = lifting(simple_graph_1)
data.batch_0 = "null"
return data
Expand All @@ -178,7 +181,7 @@ def sg1_cell_lifted(simple_graph_1):
@pytest.fixture
def simple_graph_2():
"""Create a manual graph for testing purposes.

Returns
-------
torch_geometric.data.Data
Expand Down Expand Up @@ -244,7 +247,7 @@ def simple_graph_2():
@pytest.fixture
def random_graph_input():
"""Create a random graph for testing purposes.

Returns
-------
torch.Tensor
Expand All @@ -261,13 +264,12 @@ def random_graph_input():
num_nodes = 8
d_feat = 12
x = torch.randn(num_nodes, 12)
edges_1 = torch.randint(0, num_nodes, (2, num_nodes*2))
edges_2 = torch.randint(0, num_nodes, (2, num_nodes*2))
edges_1 = torch.randint(0, num_nodes, (2, num_nodes * 2))
edges_2 = torch.randint(0, num_nodes, (2, num_nodes * 2))

d_feat_1, d_feat_2 = 5, 17

x_1 = torch.randn(num_nodes*2, d_feat_1)
x_2 = torch.randn(num_nodes*2, d_feat_2)
x_1 = torch.randn(num_nodes * 2, d_feat_1)
x_2 = torch.randn(num_nodes * 2, d_feat_2)

return x, x_1, x_2, edges_1, edges_2

Loading
Loading