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

Changing Init files and tutorials #297

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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,
Expand All @@ -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",
Expand All @@ -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",
]
11 changes: 8 additions & 3 deletions tutorials/cell/can_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -592,7 +592,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "venv_tmx",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -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,
Expand Down
11 changes: 8 additions & 3 deletions tutorials/cell/ccxn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -645,7 +645,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "venv_modelx",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/cell/cwn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion tutorials/combinatorial/hmc_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions tutorials/hypergraph/allset_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down Expand Up @@ -533,7 +533,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
Expand Down
4 changes: 2 additions & 2 deletions tutorials/hypergraph/allset_transformer_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down Expand Up @@ -515,7 +515,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/dhgcn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down
11 changes: 8 additions & 3 deletions tutorials/hypergraph/hmpnn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down Expand Up @@ -327,7 +327,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tutorials/hypergraph/hnhn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down Expand Up @@ -529,7 +529,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/hypergat_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/hypersage_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down
11 changes: 8 additions & 3 deletions tutorials/hypergraph/unigcn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -328,7 +328,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.12.7 64-bit",
"language": "python",
"name": "python3"
},
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unigcnii_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unigin_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hypergraph/unisage_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/dist2cycle_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/hsn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/san_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/sca_cmps_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/sccn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/simplicial/sccnn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"from topomodelx.nn.simplicial.sccnn import SCCNN\n",
"from topomodelx import SCCNN\n",
"from topomodelx.utils.sparse import from_sparse\n",
"\n",
"%load_ext autoreload\n",
Expand Down
Loading
Loading