|
1 |
| -# Model Paramters: 206,607 |
2 |
| -# Peak GPU memory usage: 1.57 G |
3 |
| -# RevGNN with 7 layers and 160 channels reaches around 0.8200 test accuracy. |
4 |
| -# Final Train: 0.9373, Highest Val: 0.9230, Final Test: 0.8200. |
5 |
| -# Training longer should produces better results. |
| 1 | +# Peak GPU memory usage is around 1.57 G |
| 2 | +# | RevGNN Models | Test Acc | Val Acc | |
| 3 | +# |-------------------------|-----------------|-----------------| |
| 4 | +# | 112 layers 160 channels | 0.8307 ± 0.0030 | 0.9290 ± 0.0007 | |
| 5 | +# | 7 layers 160 channels | 0.8276 ± 0.0027 | 0.9272 ± 0.0006 | |
6 | 6 |
|
7 | 7 | import os.path as osp
|
8 | 8 |
|
@@ -93,7 +93,7 @@ def forward(self, x, edge_index):
|
93 | 93 |
|
94 | 94 | train_loader = RandomNodeSampler(data, num_parts=10, shuffle=True,
|
95 | 95 | num_workers=5)
|
96 |
| -# Increase the num_parts of the test loader if you cannot have fix |
| 96 | +# Increase the num_parts of the test loader if you cannot fit |
97 | 97 | # the full batch graph into your GPU:
|
98 | 98 | test_loader = RandomNodeSampler(data, num_parts=1, num_workers=5)
|
99 | 99 |
|
@@ -180,8 +180,18 @@ def test(epoch):
|
180 | 180 | return train_acc, valid_acc, test_acc
|
181 | 181 |
|
182 | 182 |
|
183 |
| -for epoch in range(1, 501): |
| 183 | +best_val = 0.0 |
| 184 | +final_train = 0.0 |
| 185 | +final_test = 0.0 |
| 186 | +for epoch in range(1, 1001): |
184 | 187 | loss = train(epoch)
|
185 | 188 | train_acc, val_acc, test_acc = test(epoch)
|
| 189 | + if val_acc > best_val: |
| 190 | + best_val = val_acc |
| 191 | + final_train = train_acc |
| 192 | + final_test = test_acc |
186 | 193 | print(f'Loss: {loss:.4f}, Train: {train_acc:.4f}, Val: {val_acc:.4f}, '
|
187 | 194 | f'Test: {test_acc:.4f}')
|
| 195 | + |
| 196 | +print(f'Final Train: {final_train:.4f}, Best Val: {best_val:.4f}, ' |
| 197 | + f'Final Test: {final_test:.4f}') |
0 commit comments