Skip to content

Commit f3d4d16

Browse files
committed
Taking a look at Graph attention Networks
1 parent 724ddbc commit f3d4d16

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

SignalProcessingGraph.ipynb

+14-4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@
7373
"#IFrame(\"doc/SpectralGraphTheory/cbms.pdf\", width=1200, height=800)"
7474
]
7575
},
76+
{
77+
"cell_type": "markdown",
78+
"metadata": {},
79+
"source": [
80+
"Here are two very good references from Petar Veličković :\n",
81+
"* [Theoretical Foundations of Graph Neural Networks](https://www.youtube.com/watch?v=uF53xsT7mjc&ab_channel=PetarVeli%C4%8Dkovi%C4%87)\n",
82+
"* [Intro to graph neural networks (ML Tech Talks](https://www.youtube.com/watch?v=8owQBFAHw7E&ab_channel=TensorFlow)\n",
83+
"* [Recent set of references](https://twitter.com/PetarV_93/status/1306689702020382720)\n",
84+
"* [Some introduction to Graph attention network](https://petar-v.com/GAT/)"
85+
]
86+
},
7687
{
7788
"cell_type": "markdown",
7889
"metadata": {},
@@ -125,12 +136,11 @@
125136
"| Gradient operator | $(\\nabla f)_{ij} = \\sqrt{a_{ij}}(f_i-f_j)$ | $\\nabla : L^2(\\mathcal{V}) \\rightarrow L^2(\\mathcal{E})$ |\n",
126137
"| Divergence operator | $(div F)_{i} = \\frac{1}{b_i} \\sum_{j:(i,j) \\in \\mathcal{E}} \\sqrt{a_{ij}}(F_{ji}-F_{ij})$ |$div : L^2(\\mathcal{E}) \\rightarrow L^2(\\mathcal{V})$ |\n",
127138
"| Gradient Adjoint |$\\nabla^{\\star}F = -div F$ | $\\langle F,\\nabla f \\rangle_{L^2(\\mathcal{E})} = \\langle \\nabla^{\\star}F, f \\rangle_{L^2(\\mathcal{V})} = \\langle -div F, f \\rangle_{L^2(\\mathcal{V})}$ |\n",
128-
"| Laplacian operator | $(\\Delta F)_{i} = \\frac{1}{b_i} \\sum_{j:(i,j) \\in \\mathcal{E}} a_{ij}(f_i-f_j)$ | $\\Delta : L^2(\\mathcal{V}) \\rightarrow L^2(\\mathcal{V})$, this one is the $D-A$ |\n",
129139
"| Weight matrix | $A = (a_{ij})$ | | |\n",
130140
"| Degree matrix | $D = diag\\left(d_i\\right)$ where $d_i=\\sum_{j\\neq i}a_{ij})$ | | |\n",
131-
"| Unnormalized Laplacian | $\\Delta = D - A$ | | |\n",
132-
"| Normalized Laplacian | $\\Delta = I - D^{-\\frac{1}{2}} A D^{-\\frac{1}{2}}$ | | |\n",
133-
"| Random walk Laplacian | $\\Delta = I - D^{-1} A $ | | |\n",
141+
"| (Unnormalized) Laplacian operator | $(\\Delta F)_{i} = \\frac{1}{b_i} \\sum_{j:(i,j) \\in \\mathcal{E}} a_{ij}(f_i-f_j)$ | $\\Delta : L^2(\\mathcal{V}) \\rightarrow L^2(\\mathcal{V})$, this one is $\\Delta = D - A$ |\n",
142+
"| Normalized Laplacian | $(\\Delta F)_{i} = \\sum_{j:(i,j) \\in \\mathcal{E}} \\frac{1}{b_i\\sqrt{d_i d_j}} a_{ij}(f_i-f_j)$ | $\\Delta : L^2(\\mathcal{V}) \\rightarrow L^2(\\mathcal{V})$, this one is $\\Delta = I - D^{-\\frac{1}{2}} A D^{-\\frac{1}{2}}$ |\n",
143+
"| Random walk Laplacian | $\\Delta = I - D^{-1} A $ | $\\Delta : L^2(\\mathcal{V}) \\rightarrow L^2(\\mathcal{V})$, this one is $\\Delta = I - D^{-1} A $ |\n",
134144
"\n",
135145
"Those definitions are coming from slides from Xavier Bresson."
136146
]

SpectralClusteringIntroduction.ipynb

+9-23
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"metadata": {
7-
"collapsed": false
8-
},
6+
"metadata": {},
97
"outputs": [
108
{
119
"name": "stderr",
@@ -73,9 +71,7 @@
7371
{
7472
"cell_type": "code",
7573
"execution_count": 2,
76-
"metadata": {
77-
"collapsed": false
78-
},
74+
"metadata": {},
7975
"outputs": [
8076
{
8177
"data": {
@@ -126,9 +122,7 @@
126122
{
127123
"cell_type": "code",
128124
"execution_count": 3,
129-
"metadata": {
130-
"collapsed": false
131-
},
125+
"metadata": {},
132126
"outputs": [],
133127
"source": [
134128
"#Now we will concatenate those points\n",
@@ -138,9 +132,7 @@
138132
{
139133
"cell_type": "code",
140134
"execution_count": 4,
141-
"metadata": {
142-
"collapsed": false
143-
},
135+
"metadata": {},
144136
"outputs": [],
145137
"source": [
146138
"#Threshold: Below this value we consider that vertices are not connected\n",
@@ -186,9 +178,7 @@
186178
{
187179
"cell_type": "code",
188180
"execution_count": 5,
189-
"metadata": {
190-
"collapsed": false
191-
},
181+
"metadata": {},
192182
"outputs": [],
193183
"source": [
194184
"#Spectral Dimensionality reduction that will be used, must be equal to nb of class\n",
@@ -217,9 +207,7 @@
217207
{
218208
"cell_type": "code",
219209
"execution_count": 6,
220-
"metadata": {
221-
"collapsed": false
222-
},
210+
"metadata": {},
223211
"outputs": [],
224212
"source": [
225213
"NbIterKMean = 250\n",
@@ -263,9 +251,7 @@
263251
{
264252
"cell_type": "code",
265253
"execution_count": 7,
266-
"metadata": {
267-
"collapsed": false
268-
},
254+
"metadata": {},
269255
"outputs": [
270256
{
271257
"data": {
@@ -340,9 +326,9 @@
340326
"name": "python",
341327
"nbconvert_exporter": "python",
342328
"pygments_lexer": "ipython3",
343-
"version": "3.6.0"
329+
"version": "3.8.10"
344330
}
345331
},
346332
"nbformat": 4,
347-
"nbformat_minor": 0
333+
"nbformat_minor": 1
348334
}

0 commit comments

Comments
 (0)