Skip to content

Commit

Permalink
Changing the init files to import all models used in tutorials direct…
Browse files Browse the repository at this point in the history
…ly in repo. | Making required changes in tutorials as well
devendragovil committed Dec 2, 2024
1 parent fee87fd commit b6c9e29
Showing 27 changed files with 122 additions and 37 deletions.
66 changes: 66 additions & 0 deletions topomodelx/nn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"All Models to be inherited in the namespace."
from .cell.can import CAN
from .cell.can_layer import (
CANLayer,
LiftLayer,
@@ -6,14 +8,45 @@
MultiHeadLiftLayer,
PoolLayer,
)
from .cell.ccxn import CCXN
from .cell.ccxn_layer import CCXNLayer
from .cell.cwn import CWN
from .cell.cwn_layer import (
CWNLayer,
_CWNDefaultAggregate,
_CWNDefaultFirstConv,
_CWNDefaultSecondConv,
_CWNDefaultUpdate,
)
from .combinatorial.hmc import HMC
from .combinatorial.hmc_layer import HBNS, HBS, HMCLayer
from .hypergraph.allset import AllSet
from .hypergraph.allset_layer import AllSetBlock, AllSetLayer
from .hypergraph.allset_transformer import AllSetTransformer
from .hypergraph.allset_transformer_layer import (
AllSetTransformerBlock,
AllSetTransformerLayer,
MultiHeadAttention,
)
from .hypergraph.dhgcn import DHGCN
from .hypergraph.hmpnn import HMPNN
from .hypergraph.hnhn import HNHN
from .hypergraph.hypergat import HyperGAT
from .hypergraph.hypersage import HyperSAGE
from .hypergraph.unigcn import UniGCN
from .hypergraph.unigcnii import UniGCNII
from .hypergraph.unigin import UniGIN
from .hypergraph.unisage import UniSAGE
from .simplicial.dist2cycle import Dist2Cycle
from .simplicial.hsn import HSN
from .simplicial.san import SAN
from .simplicial.sca_cmps import SCACMPS
from .simplicial.sccn import SCCN
from .simplicial.sccnn import SCCNN
from .simplicial.scconv import SCConv
from .simplicial.scn2 import SCN2
from .simplicial.scnn import SCNN
from .simplicial.scone import SCoNe

__all__ = [
"LiftLayer",
@@ -28,4 +61,37 @@
"_CWNDefaultSecondConv",
"_CWNDefaultAggregate",
"_CWNDefaultUpdate",
"CAN",
"CCXN",
"CWN",
"HBNS",
"HBS",
"HMCLayer",
"HMC",
"AllSetLayer",
"AllSetBlock",
"AllSetTransformerBlock",
"AllSetTransformerLayer",
"MultiHeadAttention",
"AllSet",
"AllSetTransformer",
"DHGCN",
"HMPNN",
"HNHN",
"HyperGAT",
"HyperSAGE",
"UniGCN",
"UniGCNII",
"UniGIN",
"UniSAGE",
"Dist2Cycle",
"HSN",
"SAN",
"SCACMPS",
"SCCN",
"SCCNN",
"SCConv",
"SCN2",
"SCNN",
"SCoNe",
]
1 change: 0 additions & 1 deletion trial.txt

This file was deleted.

11 changes: 8 additions & 3 deletions tutorials/cell/can_train.ipynb
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
"from topomodelx.nn.cell.can import CAN\n",
"from topomodelx import CAN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"torch.manual_seed(0)"
@@ -592,7 +592,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "venv_tmx",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
@@ -606,7 +606,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.12.7"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
11 changes: 8 additions & 3 deletions tutorials/cell/ccxn_train.ipynb
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"from topomodelx.nn.cell.ccxn import CCXN\n",
"from topomodelx import CCXN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"torch.manual_seed(0)\n",
@@ -645,7 +645,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "venv_modelx",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
@@ -659,7 +659,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.12.7"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
2 changes: 1 addition & 1 deletion tutorials/cell/cwn_train.ipynb
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"from topomodelx.nn.cell.cwn import CWN\n",
"from topomodelx import CWN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"torch.manual_seed(0)"
2 changes: 1 addition & 1 deletion tutorials/combinatorial/hmc_train.ipynb
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@
"import torch\n",
"from torch.utils.data import DataLoader, Dataset\n",
"\n",
"from topomodelx.nn.combinatorial.hmc import HMC"
"from topomodelx import HMC"
]
},
{
4 changes: 2 additions & 2 deletions tutorials/hypergraph/allset_train.ipynb
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.allset import AllSet\n",
"from topomodelx import AllSet\n",
"\n",
"torch.manual_seed(0)"
]
@@ -533,7 +533,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
4 changes: 2 additions & 2 deletions tutorials/hypergraph/allset_transformer_train.ipynb
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.allset_transformer import AllSetTransformer\n",
"from topomodelx import AllSetTransformer\n",
"\n",
"torch.manual_seed(0)"
]
@@ -515,7 +515,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
2 changes: 1 addition & 1 deletion tutorials/hypergraph/dhgcn_train.ipynb
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"from topomodelx.nn.hypergraph.dhgcn import DHGCN\n",
"from topomodelx import DHGCN\n",
"from topomodelx.utils.sparse import from_sparse"
]
},
11 changes: 8 additions & 3 deletions tutorials/hypergraph/hmpnn_train.ipynb
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from sklearn.metrics import accuracy_score\n",
"\n",
"from topomodelx.nn.hypergraph.hmpnn import HMPNN\n",
"from topomodelx import HMPNN\n",
"\n",
"torch.manual_seed(0)"
]
@@ -327,7 +327,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
@@ -341,7 +341,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.12.7"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
4 changes: 2 additions & 2 deletions tutorials/hypergraph/hnhn_train.ipynb
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.hnhn import HNHN\n",
"from topomodelx import HNHN\n",
"\n",
"torch.manual_seed(0)"
]
@@ -529,7 +529,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
2 changes: 1 addition & 1 deletion tutorials/hypergraph/hypergat_train.ipynb
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"from topomodelx.nn.hypergraph.hypergat import HyperGAT\n",
"from topomodelx import HyperGAT\n",
"from topomodelx.utils.sparse import from_sparse"
]
},
2 changes: 1 addition & 1 deletion tutorials/hypergraph/hypersage_train.ipynb
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.hypersage import HyperSAGE\n",
"from topomodelx import HyperSAGE\n",
"\n",
"torch.manual_seed(0)"
]
11 changes: 8 additions & 3 deletions tutorials/hypergraph/unigcn_train.ipynb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
"from topomodelx.nn.hypergraph.unigcn import UniGCN\n",
"from topomodelx import UniGCN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"torch.manual_seed(0)"
@@ -328,7 +328,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
@@ -342,7 +342,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.12.7"
},
"vscode": {
"interpreter": {
"hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e"
}
}
},
"nbformat": 4,
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unigcnii_train.ipynb
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.unigcnii import UniGCNII\n",
"from topomodelx import UniGCNII\n",
"\n",
"torch.manual_seed(0)"
]
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unigin_train.ipynb
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
"from topomodelx.nn.hypergraph.unigin import UniGIN\n",
"from topomodelx import UniGIN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"torch.manual_seed(0)"
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unisage_train.ipynb
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"import torch_geometric.datasets as geom_datasets\n",
"from torch_geometric.utils import to_undirected\n",
"\n",
"from topomodelx.nn.hypergraph.unisage import UniSAGE\n",
"from topomodelx import UniSAGE\n",
"\n",
"torch.manual_seed(0)"
]
2 changes: 1 addition & 1 deletion tutorials/simplicial/dist2cycle_train.ipynb
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.dist2cycle import Dist2Cycle\n",
"from topomodelx import Dist2Cycle\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
2 changes: 1 addition & 1 deletion tutorials/simplicial/hsn_train.ipynb
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.hsn import HSN\n",
"from topomodelx import HSN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
2 changes: 1 addition & 1 deletion tutorials/simplicial/san_train.ipynb
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.san import SAN\n",
"from topomodelx import SAN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
2 changes: 1 addition & 1 deletion tutorials/simplicial/sca_cmps_train.ipynb
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.sca_cmps import SCACMPS\n",
"from topomodelx import SCACMPS\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
2 changes: 1 addition & 1 deletion tutorials/simplicial/sccn_train.ipynb
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.sccn import SCCN\n",
"from topomodelx import SCCN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
Loading

0 comments on commit b6c9e29

Please sign in to comment.