Skip to content

Commit

Permalink
Deploying to main from @ pyt-team/TopoModelX@106db16 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ffl096 committed Oct 21, 2024
1 parent 66a3fdb commit e29e8ad
Show file tree
Hide file tree
Showing 93 changed files with 197 additions and 229 deletions.
Binary file modified topomodelx/.doctrees/environment.pickle
Binary file not shown.
4 changes: 2 additions & 2 deletions topomodelx/.doctrees/nbsphinx/notebooks/cell/can_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@
],
"source": [
"import numpy as np\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"from toponetx.classes.cell_complex import CellComplex\n",
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
Expand Down Expand Up @@ -218,7 +218,7 @@
"x_1_list = []\n",
"y_list = []\n",
"for graph in dataset:\n",
" cell_complex = CellComplex(to_networkx(graph))\n",
" cell_complex = tnx.CellComplex(to_networkx(graph))\n",
" cc_list.append(cell_complex)\n",
" x_0_list.append(graph.x)\n",
" x_1_list.append(graph.edge_attr)\n",
Expand Down
4 changes: 2 additions & 2 deletions topomodelx/.doctrees/nbsphinx/notebooks/cell/ccxn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -132,7 +132,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
Expand Down
4 changes: 2 additions & 2 deletions topomodelx/.doctrees/nbsphinx/notebooks/cell/cwn_train.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -152,7 +152,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx as tnx\n",
"import torch\n",
"from toponetx.datasets.mesh import shrec_16\n",
"from torch.utils.data import DataLoader, Dataset\n",
"\n",
"from topomodelx.nn.combinatorial.hmc import HMC"
Expand Down Expand Up @@ -338,7 +338,7 @@
}
],
"source": [
"shrec_training, shrec_testing = shrec_16()"
"shrec_training, shrec_testing = tnx.datasets.shrec_16()"
]
},
{
Expand Down Expand Up @@ -839,9 +839,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "venv_modelx",
"display_name": "venv",
"language": "python",
"name": "venv_modelx"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -853,7 +853,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -98,7 +98,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.mesh.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -112,7 +112,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"metadata": {},
"outputs": [],
"source": [
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"from toponetx.classes.simplicial_complex import SimplicialComplex\n",
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
Expand Down Expand Up @@ -83,7 +83,7 @@
"x_1_list = []\n",
"y_list = []\n",
"for graph in dataset:\n",
" hg = SimplicialComplex(to_networkx(graph)).to_hypergraph()\n",
" hg = tnx.SimplicialComplex(to_networkx(graph)).to_hypergraph()\n",
" hg_list.append(hg)\n",
" x_1_list.append(graph.x.to(device))\n",
" y_list.append(graph.y.to(device))\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"metadata": {},
"outputs": [],
"source": [
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"from toponetx.classes.simplicial_complex import SimplicialComplex\n",
"from torch_geometric.datasets import TUDataset\n",
"from torch_geometric.utils.convert import to_networkx\n",
"\n",
Expand Down Expand Up @@ -78,7 +78,7 @@
"x_1_list = []\n",
"y_list = []\n",
"for graph in dataset:\n",
" hg = SimplicialComplex(to_networkx(graph)).to_hypergraph()\n",
" hg = tnx.SimplicialComplex(to_networkx(graph)).to_hypergraph()\n",
" hg_list.append(hg)\n",
" x_1_list.append(graph.x.to(device))\n",
" y_list.append(graph.y.to(device))\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"source": [
"import numpy as np\n",
"import numpy.linalg as npla\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.dist2cycle import Dist2Cycle\n",
Expand Down Expand Up @@ -72,7 +72,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.hsn import HSN\n",
Expand Down Expand Up @@ -75,7 +75,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.san import SAN\n",
Expand Down Expand Up @@ -149,7 +149,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.sca_cmps import SCACMPS\n",
Expand Down Expand Up @@ -100,7 +100,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"\n",
"from topomodelx.nn.simplicial.sccn import SCCN\n",
Expand Down Expand Up @@ -79,7 +79,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\", feat_dim=2)\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\", feat_dim=2)\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -112,7 +112,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
"x_1s = shrec[\"edge_feat\"]\n",
Expand Down Expand Up @@ -499,8 +499,6 @@
}
],
"source": [
"import toponetx.datasets.graph as graph\n",
"\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
Expand Down Expand Up @@ -533,7 +531,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)\n",
"max_rank = dataset.dim\n",
"print(max_rank)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets.graph as graph\n",
"import toponetx as tnx\n",
"import torch\n",
"from scipy.sparse import coo_matrix, diags\n",
"\n",
Expand Down Expand Up @@ -138,7 +138,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -91,7 +91,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"x_0s = shrec[\"node_feat\"]\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import toponetx.datasets as datasets\n",
"import toponetx as tnx\n",
"import torch\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
Expand Down Expand Up @@ -102,7 +102,7 @@
}
],
"source": [
"shrec, _ = datasets.mesh.shrec_16(size=\"small\")\n",
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
"\n",
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
"\n",
Expand Down Expand Up @@ -381,15 +381,6 @@
"# 2. Node Classification "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"import toponetx.datasets.graph as graph"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -413,7 +404,7 @@
}
],
"source": [
"dataset = graph.karate_club(complex_type=\"simplicial\")\n",
"dataset = tnx.datasets.karate_club(complex_type=\"simplicial\")\n",
"print(dataset)\n",
"\n",
"# Maximal simplex order\n",
Expand Down
Loading

0 comments on commit e29e8ad

Please sign in to comment.