Skip to content

Commit e78f02f

Browse files
committed
Deploying to main from @ pyt-team/TopoModelX@637fcbb 🚀
1 parent 86446a6 commit e78f02f

40 files changed

+14
-218
lines changed
31 Bytes
Binary file not shown.

topomodelx/.doctrees/nbsphinx/notebooks/cell/ccxn_train.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
"source": [
135135
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
136136
"\n",
137-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
138137
"x_0s = shrec[\"node_feat\"]\n",
139138
"x_1s = shrec[\"edge_feat\"]\n",
140139
"x_2s = shrec[\"face_feat\"]\n",
@@ -634,13 +633,6 @@
634633
" flush=True,\n",
635634
" )"
636635
]
637-
},
638-
{
639-
"cell_type": "code",
640-
"execution_count": null,
641-
"metadata": {},
642-
"outputs": [],
643-
"source": []
644636
}
645637
],
646638
"metadata": {

topomodelx/.doctrees/nbsphinx/notebooks/cell/cwn_train.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
"source": [
155155
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
156156
"\n",
157-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
158157
"x_0s = shrec[\"node_feat\"]\n",
159158
"x_1s = shrec[\"edge_feat\"]\n",
160159
"x_2s = shrec[\"face_feat\"]\n",
@@ -578,13 +577,6 @@
578577
" flush=True,\n",
579578
" )"
580579
]
581-
},
582-
{
583-
"cell_type": "code",
584-
"execution_count": null,
585-
"metadata": {},
586-
"outputs": [],
587-
"source": []
588580
}
589581
],
590582
"metadata": {

topomodelx/.doctrees/nbsphinx/notebooks/hypergraph/dhgcn_train.ipynb

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
"source": [
101101
"shrec, _ = tnx.datasets.mesh.shrec_16(size=\"small\")\n",
102102
"\n",
103-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
104103
"x_0s = shrec[\"node_feat\"]\n",
105104
"x_1s = shrec[\"edge_feat\"]\n",
106105
"x_2s = shrec[\"face_feat\"]\n",
@@ -109,26 +108,6 @@
109108
"simplexes = shrec[\"complexes\"]"
110109
]
111110
},
112-
{
113-
"cell_type": "code",
114-
"execution_count": 4,
115-
"metadata": {},
116-
"outputs": [
117-
{
118-
"data": {
119-
"text/plain": [
120-
"((100,), (100, 750, 10), (100, 500, 7), (100,), (100,))"
121-
]
122-
},
123-
"execution_count": 4,
124-
"metadata": {},
125-
"output_type": "execute_result"
126-
}
127-
],
128-
"source": [
129-
"x_0s.shape, x_1s.shape, x_2s.shape, ys.shape, simplexes.shape"
130-
]
131-
},
132111
{
133112
"cell_type": "code",
134113
"execution_count": 5,

topomodelx/.doctrees/nbsphinx/notebooks/hypergraph/hypergat_train.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"source": [
115115
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
116116
"\n",
117-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
118117
"x_0s = shrec[\"node_feat\"]\n",
119118
"x_1s = shrec[\"edge_feat\"]\n",
120119
"x_2s = shrec[\"face_feat\"]\n",

topomodelx/.doctrees/nbsphinx/notebooks/simplicial/sccnn_train.ipynb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
],
114114
"source": [
115115
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
116-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
116+
"\n",
117117
"x_0s = shrec[\"node_feat\"]\n",
118118
"x_1s = shrec[\"edge_feat\"]\n",
119119
"x_2s = shrec[\"face_feat\"]\n",
@@ -977,13 +977,6 @@
977977
" )\n",
978978
" print(f\"Test_acc: {test_accuracy:.4f}\", flush=True)"
979979
]
980-
},
981-
{
982-
"cell_type": "code",
983-
"execution_count": null,
984-
"metadata": {},
985-
"outputs": [],
986-
"source": []
987980
}
988981
],
989982
"metadata": {

topomodelx/.doctrees/nbsphinx/notebooks/simplicial/scn2_train.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"source": [
9494
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
9595
"\n",
96-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
9796
"x_0s = shrec[\"node_feat\"]\n",
9897
"x_1s = shrec[\"edge_feat\"]\n",
9998
"x_2s = shrec[\"face_feat\"]\n",
@@ -461,13 +460,6 @@
461460
" test_loss = loss_fn(y_hat, y)\n",
462461
" print(f\"Test_loss: {test_loss:.4f}\", flush=True)"
463462
]
464-
},
465-
{
466-
"cell_type": "code",
467-
"execution_count": null,
468-
"metadata": {},
469-
"outputs": [],
470-
"source": []
471463
}
472464
],
473465
"metadata": {

topomodelx/.doctrees/nbsphinx/notebooks/simplicial/scone_train.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
" \"\"\"\n",
192192
" # Plot triangles\n",
193193
" for idx in sc.skeleton(2):\n",
194+
" idx = tuple(idx)\n",
194195
" pts = np.array([coords[idx[0]], coords[idx[1]], coords[idx[2]]])\n",
195196
" poly = plt.Polygon(pts, color=\"green\", alpha=0.25)\n",
196197
" plt.gca().add_patch(poly)\n",
@@ -397,6 +398,7 @@
397398
" # Lookup table used to speed up vectorizing of trajectories\n",
398399
" self.edge_lookup_table = {}\n",
399400
" for i, edge in enumerate(self.sc.skeleton(1)):\n",
401+
" edge = tuple(edge)\n",
400402
" self.edge_lookup_table[edge] = (1, i)\n",
401403
" self.edge_lookup_table[edge[::-1]] = (-1, i)\n",
402404
"\n",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

topomodelx/_modules/topomodelx/nn/simplicial/scone.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ <h1>Source code for topomodelx.nn.simplicial.scone</h1><div class="highlight"><p
482482
<span class="c1"># Lookup table used to speed up vectorizing of trajectories</span>
483483
<span class="bp">self</span><span class="o">.</span><span class="n">edge_lookup_table</span> <span class="o">=</span> <span class="p">{}</span>
484484
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">edge</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sc</span><span class="o">.</span><span class="n">skeleton</span><span class="p">(</span><span class="mi">1</span><span class="p">)):</span>
485+
<span class="n">edge</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">edge</span><span class="p">)</span>
485486
<span class="bp">self</span><span class="o">.</span><span class="n">edge_lookup_table</span><span class="p">[</span><span class="n">edge</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
486487
<span class="bp">self</span><span class="o">.</span><span class="n">edge_lookup_table</span><span class="p">[</span><span class="n">edge</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
487488

topomodelx/_sources/notebooks/cell/ccxn_train.ipynb.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
"source": [
135135
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
136136
"\n",
137-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
138137
"x_0s = shrec[\"node_feat\"]\n",
139138
"x_1s = shrec[\"edge_feat\"]\n",
140139
"x_2s = shrec[\"face_feat\"]\n",
@@ -634,13 +633,6 @@
634633
" flush=True,\n",
635634
" )"
636635
]
637-
},
638-
{
639-
"cell_type": "code",
640-
"execution_count": null,
641-
"metadata": {},
642-
"outputs": [],
643-
"source": []
644636
}
645637
],
646638
"metadata": {

topomodelx/_sources/notebooks/cell/cwn_train.ipynb.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
"source": [
155155
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
156156
"\n",
157-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
158157
"x_0s = shrec[\"node_feat\"]\n",
159158
"x_1s = shrec[\"edge_feat\"]\n",
160159
"x_2s = shrec[\"face_feat\"]\n",
@@ -578,13 +577,6 @@
578577
" flush=True,\n",
579578
" )"
580579
]
581-
},
582-
{
583-
"cell_type": "code",
584-
"execution_count": null,
585-
"metadata": {},
586-
"outputs": [],
587-
"source": []
588580
}
589581
],
590582
"metadata": {

topomodelx/_sources/notebooks/hypergraph/dhgcn_train.ipynb.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
"source": [
101101
"shrec, _ = tnx.datasets.mesh.shrec_16(size=\"small\")\n",
102102
"\n",
103-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
104103
"x_0s = shrec[\"node_feat\"]\n",
105104
"x_1s = shrec[\"edge_feat\"]\n",
106105
"x_2s = shrec[\"face_feat\"]\n",
@@ -109,26 +108,6 @@
109108
"simplexes = shrec[\"complexes\"]"
110109
]
111110
},
112-
{
113-
"cell_type": "code",
114-
"execution_count": 4,
115-
"metadata": {},
116-
"outputs": [
117-
{
118-
"data": {
119-
"text/plain": [
120-
"((100,), (100, 750, 10), (100, 500, 7), (100,), (100,))"
121-
]
122-
},
123-
"execution_count": 4,
124-
"metadata": {},
125-
"output_type": "execute_result"
126-
}
127-
],
128-
"source": [
129-
"x_0s.shape, x_1s.shape, x_2s.shape, ys.shape, simplexes.shape"
130-
]
131-
},
132111
{
133112
"cell_type": "code",
134113
"execution_count": 5,

topomodelx/_sources/notebooks/hypergraph/hypergat_train.ipynb.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"source": [
115115
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
116116
"\n",
117-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
118117
"x_0s = shrec[\"node_feat\"]\n",
119118
"x_1s = shrec[\"edge_feat\"]\n",
120119
"x_2s = shrec[\"face_feat\"]\n",

topomodelx/_sources/notebooks/simplicial/sccnn_train.ipynb.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
],
114114
"source": [
115115
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
116-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
116+
"\n",
117117
"x_0s = shrec[\"node_feat\"]\n",
118118
"x_1s = shrec[\"edge_feat\"]\n",
119119
"x_2s = shrec[\"face_feat\"]\n",
@@ -977,13 +977,6 @@
977977
" )\n",
978978
" print(f\"Test_acc: {test_accuracy:.4f}\", flush=True)"
979979
]
980-
},
981-
{
982-
"cell_type": "code",
983-
"execution_count": null,
984-
"metadata": {},
985-
"outputs": [],
986-
"source": []
987980
}
988981
],
989982
"metadata": {

topomodelx/_sources/notebooks/simplicial/scn2_train.ipynb.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"source": [
9494
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
9595
"\n",
96-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
9796
"x_0s = shrec[\"node_feat\"]\n",
9897
"x_1s = shrec[\"edge_feat\"]\n",
9998
"x_2s = shrec[\"face_feat\"]\n",
@@ -461,13 +460,6 @@
461460
" test_loss = loss_fn(y_hat, y)\n",
462461
" print(f\"Test_loss: {test_loss:.4f}\", flush=True)"
463462
]
464-
},
465-
{
466-
"cell_type": "code",
467-
"execution_count": null,
468-
"metadata": {},
469-
"outputs": [],
470-
"source": []
471463
}
472464
],
473465
"metadata": {

topomodelx/_sources/notebooks/simplicial/scone_train.ipynb.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
" \"\"\"\n",
192192
" # Plot triangles\n",
193193
" for idx in sc.skeleton(2):\n",
194+
" idx = tuple(idx)\n",
194195
" pts = np.array([coords[idx[0]], coords[idx[1]], coords[idx[2]]])\n",
195196
" poly = plt.Polygon(pts, color=\"green\", alpha=0.25)\n",
196197
" plt.gca().add_patch(poly)\n",
@@ -397,6 +398,7 @@
397398
" # Lookup table used to speed up vectorizing of trajectories\n",
398399
" self.edge_lookup_table = {}\n",
399400
" for i, edge in enumerate(self.sc.skeleton(1)):\n",
401+
" edge = tuple(edge)\n",
400402
" self.edge_lookup_table[edge] = (1, i)\n",
401403
" self.edge_lookup_table[edge[::-1]] = (-1, i)\n",
402404
"\n",

topomodelx/notebooks/cell/ccxn_train.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ <h1>Pre-processing<a class="headerlink" href="#Pre-processing" title="Link to th
571571
</div>
572572
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">shrec</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">tnx</span><span class="o">.</span><span class="n">datasets</span><span class="o">.</span><span class="n">shrec_16</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="s2">&quot;small&quot;</span><span class="p">)</span>
573573

574-
<span class="n">shrec</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">shrec</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
575574
<span class="n">x_0s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;node_feat&quot;</span><span class="p">]</span>
576575
<span class="n">x_1s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;edge_feat&quot;</span><span class="p">]</span>
577576
<span class="n">x_2s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;face_feat&quot;</span><span class="p">]</span>
@@ -984,14 +983,6 @@ <h1>Train the Neural Network with Attention<a class="headerlink" href="#Train-th
984983
Epoch:10, Train Loss: 72.5803 Test Loss: 87.3506
985984
</pre></div></div>
986985
</div>
987-
<div class="nbinput nblast docutils container">
988-
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]:
989-
</pre></div>
990-
</div>
991-
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>
992-
</pre></div>
993-
</div>
994-
</div>
995986
</section>
996987

997988

topomodelx/notebooks/cell/ccxn_train.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
"source": [
135135
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
136136
"\n",
137-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
138137
"x_0s = shrec[\"node_feat\"]\n",
139138
"x_1s = shrec[\"edge_feat\"]\n",
140139
"x_2s = shrec[\"face_feat\"]\n",
@@ -634,13 +633,6 @@
634633
" flush=True,\n",
635634
" )"
636635
]
637-
},
638-
{
639-
"cell_type": "code",
640-
"execution_count": null,
641-
"metadata": {},
642-
"outputs": [],
643-
"source": []
644636
}
645637
],
646638
"metadata": {

topomodelx/notebooks/cell/cwn_train.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ <h1>Pre-processing<a class="headerlink" href="#Pre-processing" title="Link to th
569569
</div>
570570
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">shrec</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">tnx</span><span class="o">.</span><span class="n">datasets</span><span class="o">.</span><span class="n">shrec_16</span><span class="p">(</span><span class="n">size</span><span class="o">=</span><span class="s2">&quot;small&quot;</span><span class="p">)</span>
571571

572-
<span class="n">shrec</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">shrec</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
573572
<span class="n">x_0s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;node_feat&quot;</span><span class="p">]</span>
574573
<span class="n">x_1s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;edge_feat&quot;</span><span class="p">]</span>
575574
<span class="n">x_2s</span> <span class="o">=</span> <span class="n">shrec</span><span class="p">[</span><span class="s2">&quot;face_feat&quot;</span><span class="p">]</span>
@@ -900,14 +899,6 @@ <h1>Train the Neural Network<a class="headerlink" href="#Train-the-Neural-Networ
900899
Epoch:10, Train Loss: 74.3838 Test Loss: 40.5566
901900
</pre></div></div>
902901
</div>
903-
<div class="nbinput nblast docutils container">
904-
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]:
905-
</pre></div>
906-
</div>
907-
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>
908-
</pre></div>
909-
</div>
910-
</div>
911902
</section>
912903

913904

topomodelx/notebooks/cell/cwn_train.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
"source": [
155155
"shrec, _ = tnx.datasets.shrec_16(size=\"small\")\n",
156156
"\n",
157-
"shrec = {key: np.array(value) for key, value in shrec.items()}\n",
158157
"x_0s = shrec[\"node_feat\"]\n",
159158
"x_1s = shrec[\"edge_feat\"]\n",
160159
"x_2s = shrec[\"face_feat\"]\n",
@@ -578,13 +577,6 @@
578577
" flush=True,\n",
579578
" )"
580579
]
581-
},
582-
{
583-
"cell_type": "code",
584-
"execution_count": null,
585-
"metadata": {},
586-
"outputs": [],
587-
"source": []
588580
}
589581
],
590582
"metadata": {

0 commit comments

Comments
 (0)