|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 6, |
| 5 | + "execution_count": null, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [], |
| 8 | + "source": [ |
| 9 | + "!pip install torch-scatter -f https://data.pyg.org/whl/torch-1.9.0+cu111.html\n", |
| 10 | + "!pip install torch-sparse -f https://data.pyg.org/whl/torch-1.9.0+cu111.html\n", |
| 11 | + "!pip install torch-geometric" |
| 12 | + ] |
| 13 | + }, |
| 14 | + { |
| 15 | + "cell_type": "code", |
| 16 | + "execution_count": null, |
6 | 17 | "metadata": {}, |
7 | 18 | "outputs": [], |
8 | 19 | "source": [ |
|
30 | 41 | }, |
31 | 42 | { |
32 | 43 | "cell_type": "code", |
33 | | - "execution_count": 7, |
| 44 | + "execution_count": null, |
34 | 45 | "metadata": {}, |
35 | 46 | "outputs": [], |
36 | 47 | "source": [ |
|
42 | 53 | }, |
43 | 54 | { |
44 | 55 | "cell_type": "code", |
45 | | - "execution_count": 8, |
| 56 | + "execution_count": null, |
46 | 57 | "metadata": {}, |
47 | | - "outputs": [ |
48 | | - { |
49 | | - "name": "stdout", |
50 | | - "output_type": "stream", |
51 | | - "text": [ |
52 | | - "Data(edge_index=[2, 10556], test_mask=[2708], train_mask=[2708], val_mask=[2708], x=[2708, 1433], y=[2708])\n" |
53 | | - ] |
54 | | - } |
55 | | - ], |
| 58 | + "outputs": [], |
56 | 59 | "source": [ |
57 | 60 | "# load the Cora dataset\n", |
58 | 61 | "dataset = 'Cora'\n", |
|
64 | 67 | }, |
65 | 68 | { |
66 | 69 | "cell_type": "code", |
67 | | - "execution_count": 9, |
| 70 | + "execution_count": null, |
68 | 71 | "metadata": {}, |
69 | | - "outputs": [ |
70 | | - { |
71 | | - "name": "stdout", |
72 | | - "output_type": "stream", |
73 | | - "text": [ |
74 | | - "Data(test_neg_edge_index=[2, 527], test_pos_edge_index=[2, 527], train_neg_adj_mask=[2708, 2708], train_pos_edge_index=[2, 8976], val_neg_edge_index=[2, 263], val_pos_edge_index=[2, 263], x=[2708, 1433])\n" |
75 | | - ] |
76 | | - } |
77 | | - ], |
| 72 | + "outputs": [], |
78 | 73 | "source": [ |
79 | 74 | "# use train_test_split_edges to create neg and positive edges\n", |
80 | 75 | "data.train_mask = data.val_mask = data.test_mask = data.y = None\n", |
|
98 | 93 | }, |
99 | 94 | { |
100 | 95 | "cell_type": "code", |
101 | | - "execution_count": 11, |
| 96 | + "execution_count": null, |
102 | 97 | "metadata": {}, |
103 | 98 | "outputs": [], |
104 | 99 | "source": [ |
|
125 | 120 | }, |
126 | 121 | { |
127 | 122 | "cell_type": "code", |
128 | | - "execution_count": 12, |
| 123 | + "execution_count": null, |
129 | 124 | "metadata": {}, |
130 | 125 | "outputs": [], |
131 | 126 | "source": [ |
|
143 | 138 | }, |
144 | 139 | { |
145 | 140 | "cell_type": "code", |
146 | | - "execution_count": 13, |
| 141 | + "execution_count": null, |
147 | 142 | "metadata": {}, |
148 | 143 | "outputs": [], |
149 | 144 | "source": [ |
|
199 | 194 | }, |
200 | 195 | { |
201 | 196 | "cell_type": "code", |
202 | | - "execution_count": 14, |
| 197 | + "execution_count": null, |
203 | 198 | "metadata": {}, |
204 | | - "outputs": [ |
205 | | - { |
206 | | - "name": "stdout", |
207 | | - "output_type": "stream", |
208 | | - "text": [ |
209 | | - "Epoch: 010, Loss: 0.6837, Val: 0.7552, Test: 0.7562\n", |
210 | | - "Epoch: 020, Loss: 0.6423, Val: 0.7552, Test: 0.7562\n", |
211 | | - "Epoch: 030, Loss: 0.5490, Val: 0.7935, Test: 0.8021\n", |
212 | | - "Epoch: 040, Loss: 0.5108, Val: 0.8210, Test: 0.8486\n", |
213 | | - "Epoch: 050, Loss: 0.4894, Val: 0.8455, Test: 0.8712\n", |
214 | | - "Epoch: 060, Loss: 0.4656, Val: 0.8637, Test: 0.8966\n", |
215 | | - "Epoch: 070, Loss: 0.4585, Val: 0.8808, Test: 0.9000\n", |
216 | | - "Epoch: 080, Loss: 0.4518, Val: 0.8864, Test: 0.9084\n", |
217 | | - "Epoch: 090, Loss: 0.4458, Val: 0.8905, Test: 0.9093\n", |
218 | | - "Epoch: 100, Loss: 0.4501, Val: 0.8920, Test: 0.9111\n" |
219 | | - ] |
220 | | - } |
221 | | - ], |
| 199 | + "outputs": [], |
222 | 200 | "source": [ |
223 | 201 | "\n", |
224 | 202 | "best_val_perf = test_perf = 0\n", |
|
243 | 221 | }, |
244 | 222 | { |
245 | 223 | "cell_type": "code", |
246 | | - "execution_count": 15, |
| 224 | + "execution_count": null, |
247 | 225 | "metadata": {}, |
248 | 226 | "outputs": [], |
249 | 227 | "source": [ |
|
282 | 260 | "name": "python", |
283 | 261 | "nbconvert_exporter": "python", |
284 | 262 | "pygments_lexer": "ipython3", |
285 | | - "version": "3.8.5" |
| 263 | + "version": "3.8.3" |
286 | 264 | } |
287 | 265 | }, |
288 | 266 | "nbformat": 4, |
|
0 commit comments