├── gckn ├── __init__.py ├── gckn_fast │ ├── __init__.py │ ├── gckn_fast_cuda.cpp │ ├── gckn_fast_cuda_kernel.cu │ ├── gckn_fast.py │ └── gckn_fast.cpp ├── dynamic_pooling │ ├── __init__.py │ └── pooling_cuda.cpp ├── graphs │ ├── __init__.py │ └── setup.py ├── setup.py ├── kernels.py ├── loss.py └── ops.py ├── transformer ├── __init__.py ├── utils.py ├── data.py ├── gckn_pe.py ├── models.py └── position_encoding.py ├── figures └── figure1.png ├── Makefile ├── s_env ├── pretrained_models └── model.pkl ├── dataset └── fold-idx │ ├── MUTAG │ ├── test_idx-10.txt │ ├── test_idx-2.txt │ ├── test_idx-1.txt │ ├── test_idx-3.txt │ ├── test_idx-4.txt │ ├── test_idx-5.txt │ ├── test_idx-6.txt │ ├── test_idx-7.txt │ ├── test_idx-8.txt │ ├── test_idx-9.txt │ └── inner_folds │ │ ├── val_idx-2-1.txt │ │ ├── val_idx-10-1.txt │ │ ├── val_idx-5-1.txt │ │ ├── val_idx-6-1.txt │ │ ├── val_idx-7-1.txt │ │ ├── val_idx-8-1.txt │ │ ├── val_idx-9-1.txt │ │ ├── val_idx-1-1.txt │ │ ├── val_idx-3-1.txt │ │ ├── val_idx-4-1.txt │ │ ├── train_idx-1-1.txt │ │ ├── train_idx-3-1.txt │ │ ├── train_idx-4-1.txt │ │ ├── train_idx-8-1.txt │ │ ├── train_idx-9-1.txt │ │ ├── train_idx-5-1.txt │ │ ├── train_idx-6-1.txt │ │ ├── train_idx-7-1.txt │ │ ├── train_idx-10-1.txt │ │ └── train_idx-2-1.txt │ ├── PTC │ ├── inner_folds │ │ ├── val_idx-1-1.txt │ │ ├── val_idx-10-1.txt │ │ ├── val_idx-2-1.txt │ │ ├── val_idx-4-1.txt │ │ ├── val_idx-5-1.txt │ │ ├── val_idx-7-1.txt │ │ ├── val_idx-8-1.txt │ │ ├── val_idx-9-1.txt │ │ ├── val_idx-3-1.txt │ │ ├── val_idx-6-1.txt │ │ ├── train_idx-1-1.txt │ │ ├── train_idx-5-1.txt │ │ ├── train_idx-6-1.txt │ │ ├── train_idx-8-1.txt │ │ ├── train_idx-9-1.txt │ │ ├── train_idx-2-1.txt │ │ ├── train_idx-3-1.txt │ │ ├── train_idx-4-1.txt │ │ ├── train_idx-7-1.txt │ │ └── train_idx-10-1.txt │ ├── test_idx-3.txt │ ├── test_idx-4.txt │ ├── test_idx-1.txt │ ├── test_idx-10.txt │ ├── test_idx-2.txt │ ├── test_idx-6.txt │ ├── test_idx-7.txt │ ├── test_idx-8.txt │ ├── test_idx-5.txt │ └── test_idx-9.txt │ ├── PROTEINS │ ├── inner_folds │ │ ├── val_idx-9-1.txt │ │ ├── val_idx-1-1.txt │ │ ├── val_idx-3-1.txt │ │ ├── val_idx-4-1.txt │ │ ├── val_idx-6-1.txt │ │ ├── val_idx-10-1.txt │ │ ├── val_idx-2-1.txt │ │ ├── val_idx-7-1.txt │ │ ├── val_idx-8-1.txt │ │ └── val_idx-5-1.txt │ ├── test_idx-1.txt │ ├── test_idx-2.txt │ ├── test_idx-3.txt │ ├── test_idx-4.txt │ ├── test_idx-7.txt │ ├── test_idx-8.txt │ ├── test_idx-5.txt │ ├── test_idx-9.txt │ ├── test_idx-10.txt │ └── test_idx-6.txt │ └── NCI1 │ ├── inner_folds │ ├── val_idx-1-1.txt │ ├── val_idx-5-1.txt │ ├── val_idx-6-1.txt │ ├── val_idx-4-1.txt │ ├── val_idx-8-1.txt │ ├── val_idx-2-1.txt │ ├── val_idx-3-1.txt │ ├── val_idx-7-1.txt │ ├── val_idx-9-1.txt │ └── val_idx-10-1.txt │ ├── test_idx-2.txt │ ├── test_idx-10.txt │ ├── test_idx-7.txt │ ├── test_idx-3.txt │ ├── test_idx-4.txt │ ├── test_idx-8.txt │ ├── test_idx-9.txt │ ├── test_idx-1.txt │ ├── test_idx-5.txt │ └── test_idx-6.txt ├── setup.py ├── experiments └── data_utils.py ├── scripts ├── cv_gckn_transformer.sh └── results_gckn_transformer.py ├── .gitignore ├── setup_torch.py └── README.md /gckn/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformer/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gckn/gckn_fast/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gckn/dynamic_pooling/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gckn/graphs/__init__.py: -------------------------------------------------------------------------------- 1 | from .graphs_fast import get_paths, get_walks -------------------------------------------------------------------------------- /figures/figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inria-thoth/GraphiT/HEAD/figures/figure1.png -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | python setup.py build_ext --inplace 3 | python setup_torch.py build_ext --inplace 4 | -------------------------------------------------------------------------------- /s_env: -------------------------------------------------------------------------------- 1 | export PYTHONPATH=$PWD 2 | export TORCH_EXTENSIONS_DIR=$PWD/tmp 3 | export TORCH_HOME="$PWD/cache" 4 | -------------------------------------------------------------------------------- /pretrained_models/model.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inria-thoth/GraphiT/HEAD/pretrained_models/model.pkl -------------------------------------------------------------------------------- /transformer/utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | def count_parameters(model): 5 | return sum([p.numel() for p in model.parameters() if p.requires_grad]) 6 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-10.txt: -------------------------------------------------------------------------------- 1 | 81 2 | 55 3 | 59 4 | 149 5 | 24 6 | 157 7 | 29 8 | 3 9 | 78 10 | 16 11 | 86 12 | 35 13 | 136 14 | 166 15 | 6 16 | 4 17 | 39 18 | 96 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-2.txt: -------------------------------------------------------------------------------- 1 | 21 2 | 1 3 | 48 4 | 110 5 | 183 6 | 171 7 | 84 8 | 20 9 | 42 10 | 10 11 | 138 12 | 46 13 | 31 14 | 68 15 | 57 16 | 43 17 | 87 18 | 121 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 44 11 | 7 12 | 144 13 | 133 14 | 117 15 | 151 16 | 34 17 | 97 18 | 73 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-3.txt: -------------------------------------------------------------------------------- 1 | 104 2 | 60 3 | 65 4 | 120 5 | 61 6 | 167 7 | 17 8 | 179 9 | 127 10 | 18 11 | 101 12 | 8 13 | 14 14 | 33 15 | 53 16 | 181 17 | 41 18 | 185 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-4.txt: -------------------------------------------------------------------------------- 1 | 63 2 | 19 3 | 70 4 | 186 5 | 82 6 | 132 7 | 105 8 | 30 9 | 184 10 | 67 11 | 178 12 | 153 13 | 173 14 | 45 15 | 5 16 | 160 17 | 26 18 | 36 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-5.txt: -------------------------------------------------------------------------------- 1 | 75 2 | 25 3 | 134 4 | 66 5 | 12 6 | 150 7 | 108 8 | 175 9 | 79 10 | 47 11 | 11 12 | 76 13 | 116 14 | 124 15 | 162 16 | 22 17 | 148 18 | 93 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-6.txt: -------------------------------------------------------------------------------- 1 | 172 2 | 92 3 | 107 4 | 89 5 | 128 6 | 83 7 | 90 8 | 130 9 | 69 10 | 54 11 | 77 12 | 154 13 | 72 14 | 168 15 | 23 16 | 129 17 | 131 18 | 74 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-7.txt: -------------------------------------------------------------------------------- 1 | 146 2 | 177 3 | 112 4 | 137 5 | 94 6 | 64 7 | 176 8 | 71 9 | 143 10 | 158 11 | 15 12 | 80 13 | 145 14 | 85 15 | 103 16 | 32 17 | 62 18 | 88 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-8.txt: -------------------------------------------------------------------------------- 1 | 28 2 | 40 3 | 118 4 | 52 5 | 122 6 | 152 7 | 164 8 | 27 9 | 2 10 | 156 11 | 139 12 | 174 13 | 56 14 | 50 15 | 111 16 | 123 17 | 147 18 | 100 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/test_idx-9.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 51 3 | 102 4 | 142 5 | 141 6 | 180 7 | 155 8 | 159 9 | 98 10 | 49 11 | 165 12 | 95 13 | 115 14 | 113 15 | 140 16 | 106 17 | 125 18 | 99 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 65 2 | 14 3 | 132 4 | 178 5 | 79 6 | 22 7 | 128 8 | 90 9 | 54 10 | 88 11 | 139 12 | 56 13 | 16 14 | 163 15 | 37 16 | 187 17 | 114 18 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 44 2 | 181 3 | 82 4 | 132 5 | 150 6 | 79 7 | 47 8 | 124 9 | 72 10 | 71 11 | 15 12 | 80 13 | 152 14 | 27 15 | 147 16 | 141 17 | 13 18 | 0 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 97 2 | 43 3 | 87 4 | 120 5 | 82 6 | 30 7 | 67 8 | 130 9 | 154 10 | 28 11 | 156 12 | 111 13 | 49 14 | 95 15 | 125 16 | 149 17 | 29 18 | 166 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 34 2 | 48 3 | 171 4 | 138 5 | 68 6 | 104 7 | 17 8 | 127 9 | 18 10 | 105 11 | 153 12 | 12 13 | 22 14 | 148 15 | 145 16 | 2 17 | 123 18 | 98 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 182 2 | 7 3 | 133 4 | 117 5 | 73 6 | 1 7 | 84 8 | 42 9 | 31 10 | 68 11 | 65 12 | 167 13 | 63 14 | 132 15 | 36 16 | 174 17 | 147 18 | 29 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 58 2 | 183 3 | 46 4 | 61 5 | 101 6 | 8 7 | 181 8 | 19 9 | 132 10 | 11 11 | 124 12 | 83 13 | 90 14 | 94 15 | 143 16 | 142 17 | 155 18 | 16 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 91 2 | 133 3 | 97 4 | 110 5 | 101 6 | 33 7 | 67 8 | 173 9 | 45 10 | 150 11 | 79 12 | 107 13 | 130 14 | 32 15 | 149 16 | 24 17 | 4 18 | 187 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 42 2 | 10 3 | 167 4 | 63 5 | 173 6 | 12 7 | 107 8 | 112 9 | 176 10 | 156 11 | 111 12 | 102 13 | 142 14 | 165 15 | 95 16 | 55 17 | 3 18 | 13 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 144 2 | 117 3 | 171 4 | 57 5 | 26 6 | 150 7 | 83 8 | 130 9 | 154 10 | 74 11 | 71 12 | 118 13 | 56 14 | 100 15 | 159 16 | 95 17 | 78 18 | 114 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/val_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 126 2 | 170 3 | 133 4 | 73 5 | 171 6 | 31 7 | 185 8 | 12 9 | 47 10 | 116 11 | 131 12 | 112 13 | 15 14 | 103 15 | 118 16 | 29 17 | 114 18 | 0 19 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 119 2 | 24 3 | 330 4 | 240 5 | 321 6 | 100 7 | 27 8 | 105 9 | 219 10 | 176 11 | 324 12 | 177 13 | 145 14 | 30 15 | 170 16 | 83 17 | 66 18 | 9 19 | 168 20 | 2 21 | 287 22 | 35 23 | 138 24 | 62 25 | 323 26 | 209 27 | 283 28 | 242 29 | 270 30 | 243 31 | 341 32 | 340 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 308 2 | 57 3 | 304 4 | 13 5 | 185 6 | 172 7 | 124 8 | 214 9 | 6 10 | 219 11 | 207 12 | 241 13 | 4 14 | 1 15 | 77 16 | 213 17 | 109 18 | 59 19 | 236 20 | 170 21 | 168 22 | 260 23 | 75 24 | 281 25 | 19 26 | 117 27 | 242 28 | 179 29 | 286 30 | 148 31 | 25 32 | 235 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 103 2 | 51 3 | 295 4 | 129 5 | 37 6 | 27 7 | 34 8 | 207 9 | 230 10 | 177 11 | 164 12 | 30 13 | 272 14 | 313 15 | 268 16 | 189 17 | 2 18 | 289 19 | 35 20 | 155 21 | 309 22 | 229 23 | 91 24 | 94 25 | 60 26 | 76 27 | 226 28 | 237 29 | 106 30 | 162 31 | 285 32 | 263 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 200 2 | 175 3 | 95 4 | 187 5 | 291 6 | 119 7 | 239 8 | 330 9 | 307 10 | 305 11 | 325 12 | 97 13 | 271 14 | 0 15 | 29 16 | 203 17 | 84 18 | 114 19 | 32 20 | 331 21 | 323 22 | 11 23 | 169 24 | 111 25 | 148 26 | 244 27 | 222 28 | 292 29 | 85 30 | 23 31 | 5 32 | 235 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 200 2 | 78 3 | 328 4 | 119 5 | 12 6 | 128 7 | 252 8 | 20 9 | 184 10 | 215 11 | 295 12 | 97 13 | 0 14 | 6 15 | 65 16 | 112 17 | 192 18 | 68 19 | 56 20 | 332 21 | 299 22 | 281 23 | 147 24 | 276 25 | 181 26 | 226 27 | 275 28 | 25 29 | 190 30 | 262 31 | 258 32 | 182 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 200 2 | 45 3 | 174 4 | 254 5 | 80 6 | 330 7 | 202 8 | 49 9 | 159 10 | 129 11 | 73 12 | 56 13 | 52 14 | 108 15 | 30 16 | 246 17 | 157 18 | 259 19 | 7 20 | 335 21 | 179 22 | 286 23 | 181 24 | 270 25 | 243 26 | 99 27 | 25 28 | 190 29 | 87 30 | 89 31 | 340 32 | 267 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 103 2 | 211 3 | 16 4 | 333 5 | 175 6 | 78 7 | 328 8 | 13 9 | 24 10 | 20 11 | 305 12 | 39 13 | 310 14 | 92 15 | 73 16 | 205 17 | 77 18 | 134 19 | 272 20 | 83 21 | 168 22 | 332 23 | 274 24 | 75 25 | 165 26 | 113 27 | 152 28 | 275 29 | 256 30 | 338 31 | 326 32 | 285 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 298 3 | 78 4 | 249 5 | 80 6 | 330 7 | 55 8 | 252 9 | 184 10 | 240 11 | 140 12 | 49 13 | 81 14 | 205 15 | 178 16 | 207 17 | 4 18 | 56 19 | 52 20 | 146 21 | 118 22 | 313 23 | 17 24 | 156 25 | 38 26 | 67 27 | 150 28 | 312 29 | 259 30 | 169 31 | 273 32 | 339 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-3.txt: -------------------------------------------------------------------------------- 1 | 321 2 | 140 3 | 295 4 | 225 5 | 172 6 | 97 7 | 33 8 | 271 9 | 142 10 | 90 11 | 202 12 | 124 13 | 278 14 | 36 15 | 96 16 | 154 17 | 49 18 | 199 19 | 159 20 | 39 21 | 79 22 | 126 23 | 0 24 | 214 25 | 320 26 | 81 27 | 310 28 | 129 29 | 92 30 | 37 31 | 6 32 | 53 33 | 160 34 | 245 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-4.txt: -------------------------------------------------------------------------------- 1 | 65 2 | 112 3 | 73 4 | 228 5 | 212 6 | 120 7 | 43 8 | 100 9 | 196 10 | 149 11 | 205 12 | 300 13 | 178 14 | 21 15 | 27 16 | 224 17 | 34 18 | 105 19 | 219 20 | 192 21 | 207 22 | 221 23 | 176 24 | 241 25 | 68 26 | 151 27 | 324 28 | 4 29 | 1 30 | 56 31 | 77 32 | 213 33 | 109 34 | 52 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 308 2 | 280 3 | 161 4 | 13 5 | 54 6 | 15 7 | 116 8 | 307 9 | 20 10 | 305 11 | 212 12 | 34 13 | 77 14 | 110 15 | 114 16 | 118 17 | 246 18 | 133 19 | 287 20 | 277 21 | 32 22 | 165 23 | 209 24 | 206 25 | 232 26 | 148 27 | 76 28 | 222 29 | 261 30 | 338 31 | 265 32 | 326 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/val_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 290 2 | 74 3 | 328 4 | 174 5 | 248 6 | 254 7 | 12 8 | 20 9 | 122 10 | 325 11 | 321 12 | 36 13 | 129 14 | 178 15 | 1 16 | 203 17 | 22 18 | 108 19 | 114 20 | 313 21 | 331 22 | 309 23 | 147 24 | 229 25 | 137 26 | 312 27 | 201 28 | 25 29 | 234 30 | 292 31 | 182 32 | 139 33 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 308 12 | 200 13 | 301 14 | 333 15 | 255 16 | 337 17 | 175 18 | 95 19 | 64 20 | 327 21 | 280 22 | 247 23 | 78 24 | 130 25 | 187 26 | 57 27 | 74 28 | 328 29 | 173 30 | 45 31 | 174 32 | 248 33 | 161 34 | 143 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-10.txt: -------------------------------------------------------------------------------- 1 | 265 2 | 158 3 | 319 4 | 85 5 | 262 6 | 47 7 | 18 8 | 237 9 | 218 10 | 284 11 | 273 12 | 46 13 | 106 14 | 125 15 | 288 16 | 258 17 | 334 18 | 182 19 | 339 20 | 162 21 | 3 22 | 87 23 | 139 24 | 326 25 | 227 26 | 89 27 | 71 28 | 183 29 | 23 30 | 285 31 | 41 32 | 5 33 | 340 34 | 263 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-2.txt: -------------------------------------------------------------------------------- 1 | 31 2 | 291 3 | 304 4 | 316 5 | 13 6 | 249 7 | 185 8 | 329 9 | 306 10 | 254 11 | 197 12 | 119 13 | 80 14 | 239 15 | 24 16 | 54 17 | 330 18 | 233 19 | 15 20 | 116 21 | 12 22 | 55 23 | 128 24 | 307 25 | 252 26 | 20 27 | 28 28 | 122 29 | 184 30 | 303 31 | 215 32 | 240 33 | 305 34 | 325 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-6.txt: -------------------------------------------------------------------------------- 1 | 188 2 | 83 3 | 268 4 | 189 5 | 66 6 | 72 7 | 246 8 | 314 9 | 311 10 | 9 11 | 157 12 | 168 13 | 166 14 | 133 15 | 2 16 | 296 17 | 257 18 | 17 19 | 322 20 | 332 21 | 274 22 | 131 23 | 289 24 | 287 25 | 156 26 | 260 27 | 35 28 | 44 29 | 277 30 | 198 31 | 238 32 | 32 33 | 50 34 | 58 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-7.txt: -------------------------------------------------------------------------------- 1 | 104 2 | 144 3 | 121 4 | 75 5 | 266 6 | 155 7 | 299 8 | 38 9 | 331 10 | 281 11 | 180 12 | 297 13 | 309 14 | 138 15 | 88 16 | 62 17 | 165 18 | 323 19 | 135 20 | 26 21 | 163 22 | 167 23 | 136 24 | 67 25 | 282 26 | 147 27 | 150 28 | 8 29 | 279 30 | 11 31 | 98 32 | 19 33 | 229 34 | 193 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-8.txt: -------------------------------------------------------------------------------- 1 | 93 2 | 102 3 | 91 4 | 250 5 | 137 6 | 132 7 | 208 8 | 204 9 | 94 10 | 312 11 | 60 12 | 186 13 | 259 14 | 10 15 | 61 16 | 7 17 | 209 18 | 141 19 | 70 20 | 169 21 | 117 22 | 335 23 | 283 24 | 42 25 | 206 26 | 336 27 | 123 28 | 276 29 | 194 30 | 242 31 | 201 32 | 223 33 | 179 34 | 127 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-5.txt: -------------------------------------------------------------------------------- 1 | 134 2 | 29 3 | 217 4 | 230 5 | 82 6 | 210 7 | 203 8 | 315 9 | 177 10 | 145 11 | 84 12 | 146 13 | 22 14 | 110 15 | 108 16 | 59 17 | 114 18 | 118 19 | 164 20 | 269 21 | 30 22 | 293 23 | 191 24 | 302 25 | 317 26 | 253 27 | 251 28 | 272 29 | 313 30 | 343 31 | 236 32 | 86 33 | 195 34 | 170 35 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/test_idx-9.txt: -------------------------------------------------------------------------------- 1 | 232 2 | 286 3 | 220 4 | 111 5 | 148 6 | 181 7 | 76 8 | 101 9 | 113 10 | 342 11 | 244 12 | 226 13 | 270 14 | 222 15 | 261 16 | 48 17 | 69 18 | 216 19 | 40 20 | 243 21 | 153 22 | 231 23 | 152 24 | 99 25 | 294 26 | 275 27 | 256 28 | 318 29 | 25 30 | 341 31 | 338 32 | 190 33 | 234 34 | 292 35 | -------------------------------------------------------------------------------- /gckn/setup.py: -------------------------------------------------------------------------------- 1 | def configuration(parent_package='', top_path=None): 2 | from numpy.distutils.misc_util import Configuration 3 | 4 | config = Configuration('gckn', parent_package, top_path) 5 | 6 | config.add_subpackage('graphs') 7 | 8 | return config 9 | 10 | 11 | if __name__ == '__main__': 12 | from numpy.distutils.core import setup 13 | setup(**configuration(top_path='').todict()) 14 | -------------------------------------------------------------------------------- /gckn/kernels.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import torch 3 | 4 | from gckn.path_kernel import pathkernel 5 | 6 | 7 | def exp(x, alpha): 8 | return torch.exp(alpha*(x - 1.)) 9 | 10 | 11 | def linear(x, alpha): 12 | return x 13 | 14 | 15 | def d_exp(x, alpha): 16 | return alpha * exp(x, alpha) 17 | 18 | 19 | kernels = { 20 | "exp": exp, 21 | "linear": linear 22 | } 23 | 24 | d_kernels = { 25 | "exp": d_exp, 26 | "linear": linear 27 | } 28 | -------------------------------------------------------------------------------- /gckn/graphs/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.extension import Extension 2 | 3 | import numpy 4 | 5 | 6 | def configuration(parent_package='', top_path=None): 7 | from numpy.distutils.misc_util import Configuration 8 | 9 | config = Configuration('graphs', parent_package, top_path) 10 | 11 | extensions = [ 12 | Extension("gckn.graphs.graphs_fast", 13 | ['gckn/graphs/graphs_fast.pyx'], 14 | extra_compile_args = ["-ffast-math"], 15 | include_dirs = [numpy.get_include()] 16 | ) 17 | ] 18 | 19 | 20 | config.ext_modules += extensions 21 | 22 | return config 23 | 24 | 25 | if __name__ == '__main__': 26 | from numpy.distutils.core import setup 27 | setup(**configuration(top_path='').todict()) 28 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | from Cython.Build import cythonize 7 | from setuptools import find_packages 8 | 9 | def configuration(parent_package='', top_path=None): 10 | if os.path.exists('MANIFEST'): 11 | os.remove('MANIFEST') 12 | 13 | from numpy.distutils.misc_util import Configuration 14 | config = Configuration(None, parent_package, top_path) 15 | 16 | config.set_options(ignore_setup_xxx_py=True, 17 | assume_default_configuration=True, 18 | delegate_options_to_subpackages=True, 19 | quiet=True) 20 | 21 | config.add_subpackage('gckn') 22 | 23 | config.ext_modules = cythonize(config.ext_modules, nthreads=4) 24 | 25 | return config 26 | 27 | if __name__ == "__main__": 28 | from numpy.distutils.core import setup 29 | setup(**configuration(top_path='').todict()) 30 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 893 2 | 774 3 | 337 4 | 544 5 | 310 6 | 842 7 | 528 8 | 814 9 | 986 10 | 909 11 | 438 12 | 43 13 | 188 14 | 162 15 | 21 16 | 947 17 | 885 18 | 726 19 | 224 20 | 832 21 | 261 22 | 328 23 | 280 24 | 59 25 | 38 26 | 422 27 | 747 28 | 123 29 | 800 30 | 214 31 | 535 32 | 780 33 | 352 34 | 642 35 | 968 36 | 938 37 | 637 38 | 1006 39 | 49 40 | 1095 41 | 61 42 | 404 43 | 479 44 | 734 45 | 807 46 | 861 47 | 184 48 | 1100 49 | 157 50 | 160 51 | 927 52 | 794 53 | 28 54 | 167 55 | 512 56 | 306 57 | 277 58 | 854 59 | 881 60 | 93 61 | 1073 62 | 727 63 | 755 64 | 652 65 | 790 66 | 605 67 | 939 68 | 651 69 | 713 70 | 377 71 | 342 72 | 117 73 | 598 74 | 387 75 | 523 76 | 40 77 | 929 78 | 201 79 | 741 80 | 556 81 | 675 82 | 122 83 | 253 84 | 998 85 | 251 86 | 385 87 | 856 88 | 920 89 | 865 90 | 864 91 | 285 92 | 431 93 | 4 94 | 836 95 | 1071 96 | 329 97 | 125 98 | 619 99 | 519 100 | 357 101 | 64 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 449 2 | 100 3 | 152 4 | 21 5 | 906 6 | 772 7 | 143 8 | 947 9 | 974 10 | 137 11 | 747 12 | 822 13 | 1001 14 | 170 15 | 229 16 | 177 17 | 196 18 | 245 19 | 653 20 | 1044 21 | 19 22 | 36 23 | 666 24 | 404 25 | 908 26 | 333 27 | 341 28 | 948 29 | 671 30 | 1 31 | 407 32 | 818 33 | 729 34 | 843 35 | 309 36 | 927 37 | 997 38 | 568 39 | 103 40 | 907 41 | 1076 42 | 1002 43 | 230 44 | 872 45 | 23 46 | 1101 47 | 593 48 | 1087 49 | 558 50 | 496 51 | 98 52 | 765 53 | 720 54 | 426 55 | 141 56 | 853 57 | 284 58 | 793 59 | 757 60 | 296 61 | 638 62 | 228 63 | 549 64 | 413 65 | 741 66 | 207 67 | 1042 68 | 643 69 | 186 70 | 421 71 | 124 72 | 120 73 | 159 74 | 71 75 | 625 76 | 166 77 | 983 78 | 888 79 | 79 80 | 646 81 | 1018 82 | 993 83 | 764 84 | 748 85 | 924 86 | 405 87 | 645 88 | 634 89 | 447 90 | 769 91 | 283 92 | 585 93 | 792 94 | 268 95 | 488 96 | 247 97 | 940 98 | 1092 99 | 219 100 | 564 101 | 314 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 749 2 | 762 3 | 358 4 | 271 5 | 759 6 | 67 7 | 294 8 | 700 9 | 842 10 | 751 11 | 909 12 | 259 13 | 192 14 | 31 15 | 756 16 | 180 17 | 830 18 | 947 19 | 761 20 | 286 21 | 210 22 | 328 23 | 1005 24 | 197 25 | 1025 26 | 877 27 | 118 28 | 386 29 | 666 30 | 464 31 | 404 32 | 723 33 | 237 34 | 577 35 | 667 36 | 278 37 | 220 38 | 612 39 | 241 40 | 1068 41 | 898 42 | 290 43 | 597 44 | 235 45 | 62 46 | 1075 47 | 685 48 | 797 49 | 583 50 | 327 51 | 755 52 | 955 53 | 289 54 | 934 55 | 509 56 | 232 57 | 463 58 | 525 59 | 189 60 | 1109 61 | 491 62 | 85 63 | 580 64 | 912 65 | 172 66 | 266 67 | 741 68 | 462 69 | 655 70 | 565 71 | 555 72 | 889 73 | 736 74 | 546 75 | 1069 76 | 480 77 | 1052 78 | 71 79 | 1036 80 | 303 81 | 776 82 | 305 83 | 13 84 | 503 85 | 994 86 | 767 87 | 550 88 | 589 89 | 631 90 | 865 91 | 416 92 | 707 93 | 163 94 | 248 95 | 111 96 | 1071 97 | 329 98 | 925 99 | 619 100 | 219 101 | 985 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 414 2 | 527 3 | 922 4 | 845 5 | 271 6 | 760 7 | 698 8 | 1064 9 | 975 10 | 449 11 | 100 12 | 1000 13 | 116 14 | 756 15 | 466 16 | 50 17 | 1105 18 | 537 19 | 262 20 | 37 21 | 47 22 | 203 23 | 436 24 | 1067 25 | 554 26 | 204 27 | 855 28 | 827 29 | 293 30 | 531 31 | 291 32 | 899 33 | 154 34 | 146 35 | 543 36 | 236 37 | 184 38 | 453 39 | 567 40 | 660 41 | 56 42 | 1020 43 | 597 44 | 354 45 | 174 46 | 257 47 | 648 48 | 988 49 | 694 50 | 766 51 | 599 52 | 1041 53 | 1099 54 | 593 55 | 396 56 | 693 57 | 727 58 | 595 59 | 928 60 | 783 61 | 1048 62 | 866 63 | 377 64 | 525 65 | 72 66 | 638 67 | 201 68 | 655 69 | 297 70 | 873 71 | 980 72 | 990 73 | 594 74 | 45 75 | 44 76 | 346 77 | 969 78 | 902 79 | 511 80 | 455 81 | 663 82 | 764 83 | 808 84 | 748 85 | 730 86 | 795 87 | 13 88 | 706 89 | 699 90 | 104 91 | 1032 92 | 431 93 | 465 94 | 378 95 | 792 96 | 488 97 | 403 98 | 586 99 | 22 100 | 1053 101 | 314 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 414 2 | 845 3 | 337 4 | 55 5 | 451 6 | 700 7 | 1011 8 | 73 9 | 182 10 | 259 11 | 449 12 | 63 13 | 100 14 | 255 15 | 770 16 | 1093 17 | 819 18 | 372 19 | 885 20 | 328 21 | 0 22 | 374 23 | 433 24 | 520 25 | 332 26 | 493 27 | 531 28 | 624 29 | 915 30 | 535 31 | 642 32 | 91 33 | 146 34 | 66 35 | 234 36 | 1095 37 | 1005 38 | 177 39 | 196 40 | 862 41 | 473 42 | 664 43 | 386 44 | 545 45 | 499 46 | 313 47 | 133 48 | 839 49 | 419 50 | 734 51 | 459 52 | 1021 53 | 948 54 | 671 55 | 809 56 | 878 57 | 27 58 | 1100 59 | 160 60 | 660 61 | 174 62 | 794 63 | 235 64 | 616 65 | 482 66 | 758 67 | 98 68 | 720 69 | 342 70 | 161 71 | 608 72 | 172 73 | 228 74 | 914 75 | 895 76 | 990 77 | 411 78 | 932 79 | 471 80 | 251 81 | 856 82 | 356 83 | 677 84 | 808 85 | 860 86 | 126 87 | 1043 88 | 557 89 | 437 90 | 870 91 | 769 92 | 1008 93 | 627 94 | 206 95 | 285 96 | 836 97 | 247 98 | 940 99 | 1079 100 | 985 101 | 692 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 684 2 | 762 3 | 343 4 | 596 5 | 1070 6 | 746 7 | 551 8 | 936 9 | 960 10 | 363 11 | 53 12 | 205 13 | 149 14 | 742 15 | 1000 16 | 756 17 | 906 18 | 466 19 | 581 20 | 1026 21 | 508 22 | 812 23 | 772 24 | 1030 25 | 910 26 | 267 27 | 17 28 | 280 29 | 876 30 | 520 31 | 195 32 | 140 33 | 427 34 | 831 35 | 946 36 | 492 37 | 504 38 | 229 39 | 66 40 | 1044 41 | 7 42 | 545 43 | 723 44 | 499 45 | 732 46 | 128 47 | 133 48 | 600 49 | 223 50 | 348 51 | 945 52 | 450 53 | 94 54 | 407 55 | 279 56 | 321 57 | 1059 58 | 696 59 | 1068 60 | 660 61 | 290 62 | 28 63 | 456 64 | 167 65 | 482 66 | 779 67 | 398 68 | 694 69 | 265 70 | 351 71 | 230 72 | 1087 73 | 773 74 | 1048 75 | 232 76 | 834 77 | 704 78 | 463 79 | 720 80 | 495 81 | 962 82 | 284 83 | 491 84 | 521 85 | 851 86 | 390 87 | 92 88 | 1086 89 | 207 90 | 502 91 | 722 92 | 114 93 | 1088 94 | 159 95 | 75 96 | 132 97 | 1039 98 | 272 99 | 615 100 | 808 101 | 750 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 183 2 | 1103 3 | 527 4 | 871 5 | 439 6 | 880 7 | 746 8 | 55 9 | 1015 10 | 1064 11 | 824 12 | 1047 13 | 127 14 | 1011 15 | 975 16 | 149 17 | 541 18 | 434 19 | 31 20 | 1056 21 | 633 22 | 970 23 | 883 24 | 624 25 | 423 26 | 644 27 | 154 28 | 987 29 | 695 30 | 524 31 | 577 32 | 128 33 | 1108 34 | 604 35 | 933 36 | 318 37 | 921 38 | 169 39 | 807 40 | 984 41 | 392 42 | 481 43 | 1059 44 | 696 45 | 567 46 | 997 47 | 28 48 | 1083 49 | 697 50 | 648 51 | 446 52 | 771 53 | 992 54 | 23 55 | 269 56 | 548 57 | 668 58 | 327 59 | 955 60 | 903 61 | 397 62 | 232 63 | 478 64 | 221 65 | 448 66 | 141 67 | 931 68 | 316 69 | 610 70 | 793 71 | 786 72 | 491 73 | 613 74 | 580 75 | 659 76 | 383 77 | 1080 78 | 256 79 | 112 80 | 413 81 | 979 82 | 852 83 | 89 84 | 1004 85 | 655 86 | 930 87 | 675 88 | 346 89 | 292 90 | 579 91 | 367 92 | 578 93 | 561 94 | 588 95 | 305 96 | 591 97 | 865 98 | 707 99 | 614 100 | 125 101 | 564 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 916 2 | 954 3 | 57 4 | 243 5 | 922 6 | 1034 7 | 375 8 | 679 9 | 1015 10 | 1064 11 | 127 12 | 192 13 | 742 14 | 1000 15 | 906 16 | 143 17 | 222 18 | 224 19 | 210 20 | 213 21 | 280 22 | 754 23 | 827 24 | 837 25 | 140 26 | 1084 27 | 534 28 | 423 29 | 170 30 | 968 31 | 234 32 | 1025 33 | 477 34 | 875 35 | 80 36 | 1063 37 | 479 38 | 577 39 | 1040 40 | 604 41 | 810 42 | 1021 43 | 150 44 | 612 45 | 279 46 | 618 47 | 184 48 | 737 49 | 763 50 | 661 51 | 290 52 | 500 53 | 733 54 | 406 55 | 745 56 | 576 57 | 142 58 | 753 59 | 779 60 | 796 61 | 77 62 | 1091 63 | 12 64 | 669 65 | 652 66 | 350 67 | 522 68 | 509 69 | 979 70 | 741 71 | 89 72 | 555 73 | 675 74 | 411 75 | 29 76 | 153 77 | 1039 78 | 547 79 | 663 80 | 301 81 | 231 82 | 486 83 | 603 84 | 750 85 | 311 86 | 802 87 | 591 88 | 589 89 | 1098 90 | 39 91 | 864 92 | 42 93 | 206 94 | 283 95 | 285 96 | 789 97 | 836 98 | 111 99 | 519 100 | 564 101 | 1089 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 916 2 | 375 3 | 67 4 | 363 5 | 1047 6 | 127 7 | 100 8 | 151 9 | 255 10 | 819 11 | 466 12 | 101 13 | 508 14 | 319 15 | 830 16 | 772 17 | 143 18 | 947 19 | 433 20 | 203 21 | 520 22 | 1019 23 | 1067 24 | 204 25 | 258 26 | 1084 27 | 957 28 | 250 29 | 883 30 | 54 31 | 291 32 | 562 33 | 229 34 | 806 35 | 552 36 | 473 37 | 118 38 | 36 39 | 386 40 | 943 41 | 404 42 | 402 43 | 600 44 | 949 45 | 676 46 | 407 47 | 27 48 | 321 49 | 696 50 | 453 51 | 1068 52 | 160 53 | 516 54 | 8 55 | 456 56 | 900 57 | 779 58 | 70 59 | 967 60 | 446 61 | 1076 62 | 766 63 | 87 64 | 715 65 | 872 66 | 1033 67 | 1065 68 | 590 69 | 713 70 | 720 71 | 141 72 | 962 73 | 598 74 | 296 75 | 1080 76 | 390 77 | 144 78 | 412 79 | 356 80 | 469 81 | 808 82 | 730 83 | 507 84 | 1012 85 | 13 86 | 311 87 | 802 88 | 557 89 | 626 90 | 405 91 | 437 92 | 76 93 | 1008 94 | 461 95 | 1082 96 | 789 97 | 886 98 | 940 99 | 690 100 | 1046 101 | 1053 102 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/inner_folds/val_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 83 2 | 337 3 | 176 4 | 310 5 | 989 6 | 1064 7 | 135 8 | 188 9 | 78 10 | 1000 11 | 640 12 | 242 13 | 113 14 | 687 15 | 947 16 | 267 17 | 222 18 | 1029 19 | 32 20 | 1074 21 | 941 22 | 1054 23 | 1024 24 | 123 25 | 147 26 | 291 27 | 535 28 | 709 29 | 504 30 | 637 31 | 229 32 | 49 33 | 877 34 | 664 35 | 485 36 | 695 37 | 545 38 | 14 39 | 499 40 | 237 41 | 1038 42 | 743 43 | 450 44 | 512 45 | 967 46 | 265 47 | 872 48 | 277 49 | 797 50 | 991 51 | 1073 52 | 669 53 | 727 54 | 1028 55 | 327 56 | 982 57 | 595 58 | 289 59 | 928 60 | 121 61 | 939 62 | 48 63 | 765 64 | 463 65 | 371 66 | 72 67 | 340 68 | 608 69 | 580 70 | 923 71 | 638 72 | 523 73 | 256 74 | 483 75 | 201 76 | 741 77 | 186 78 | 88 79 | 106 80 | 122 81 | 239 82 | 178 83 | 75 84 | 740 85 | 1058 86 | 1062 87 | 1022 88 | 764 89 | 808 90 | 924 91 | 689 92 | 264 93 | 370 94 | 447 95 | 864 96 | 978 97 | 287 98 | 560 99 | 614 100 | 848 101 | 22 102 | 454 103 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-1.txt: -------------------------------------------------------------------------------- 1 | 893 2 | 828 3 | 826 4 | 774 5 | 850 6 | 183 7 | 916 8 | 414 9 | 83 10 | 954 11 | 684 12 | 57 13 | 749 14 | 1103 15 | 365 16 | 658 17 | 527 18 | 762 19 | 282 20 | 582 21 | 343 22 | 243 23 | 922 24 | 320 25 | 10 26 | 596 27 | 845 28 | 358 29 | 3 30 | 489 31 | 1034 32 | 871 33 | 271 34 | 171 35 | 1070 36 | 375 37 | 518 38 | 418 39 | 439 40 | 337 41 | 553 42 | 69 43 | 544 44 | 498 45 | 84 46 | 880 47 | 746 48 | 107 49 | 1094 50 | 55 51 | 1035 52 | 16 53 | 451 54 | 551 55 | 759 56 | 760 57 | 34 58 | 926 59 | 936 60 | 176 61 | 310 62 | 679 63 | 989 64 | 1015 65 | 960 66 | 95 67 | 67 68 | 294 69 | 700 70 | 363 71 | 842 72 | 559 73 | 698 74 | 53 75 | 611 76 | 108 77 | 1064 78 | 216 79 | 824 80 | 1047 81 | 205 82 | 751 83 | 74 84 | 399 85 | 785 86 | 528 87 | 680 88 | 127 89 | 135 90 | 814 91 | 360 92 | 334 93 | 109 94 | 1011 95 | 73 96 | 986 97 | 975 98 | 149 99 | 952 100 | 909 101 | 182 102 | 60 103 | 541 104 | 686 105 | 768 106 | 259 107 | 192 108 | 438 109 | 434 110 | 31 111 | 145 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-2.txt: -------------------------------------------------------------------------------- 1 | 781 2 | 449 3 | 63 4 | 43 5 | 100 6 | 151 7 | 255 8 | 376 9 | 432 10 | 770 11 | 188 12 | 78 13 | 742 14 | 1000 15 | 162 16 | 999 17 | 115 18 | 152 19 | 804 20 | 1093 21 | 935 22 | 662 23 | 116 24 | 21 25 | 819 26 | 274 27 | 539 28 | 533 29 | 756 30 | 640 31 | 906 32 | 466 33 | 242 34 | 180 35 | 409 36 | 190 37 | 101 38 | 181 39 | 950 40 | 113 41 | 581 42 | 1026 43 | 2 44 | 50 45 | 191 46 | 678 47 | 458 48 | 506 49 | 372 50 | 508 51 | 833 52 | 575 53 | 812 54 | 193 55 | 319 56 | 830 57 | 1105 58 | 772 59 | 687 60 | 1030 61 | 910 62 | 630 63 | 143 64 | 947 65 | 537 66 | 761 67 | 267 68 | 885 69 | 222 70 | 726 71 | 224 72 | 286 73 | 262 74 | 681 75 | 210 76 | 194 77 | 1110 78 | 1029 79 | 213 80 | 788 81 | 974 82 | 844 83 | 832 84 | 261 85 | 37 86 | 890 87 | 328 88 | 17 89 | 428 90 | 0 91 | 32 92 | 443 93 | 874 94 | 336 95 | 280 96 | 374 97 | 433 98 | 1074 99 | 322 100 | 47 101 | 203 102 | 941 103 | 1054 104 | 164 105 | 876 106 | 892 107 | 829 108 | 520 109 | 708 110 | 1019 111 | 942 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-3.txt: -------------------------------------------------------------------------------- 1 | 436 2 | 1067 3 | 554 4 | 1056 5 | 195 6 | 59 7 | 911 8 | 1112 9 | 716 10 | 633 11 | 137 12 | 134 13 | 609 14 | 1024 15 | 38 16 | 445 17 | 204 18 | 258 19 | 51 20 | 198 21 | 408 22 | 373 23 | 754 24 | 855 25 | 827 26 | 837 27 | 963 28 | 332 29 | 315 30 | 422 31 | 355 32 | 857 33 | 293 34 | 747 35 | 140 36 | 981 37 | 493 38 | 531 39 | 1084 40 | 123 41 | 957 42 | 427 43 | 970 44 | 147 45 | 800 46 | 250 47 | 501 48 | 883 49 | 54 50 | 884 51 | 822 52 | 388 53 | 665 54 | 624 55 | 353 56 | 199 57 | 976 58 | 1010 59 | 281 60 | 915 61 | 1107 62 | 816 63 | 291 64 | 214 65 | 535 66 | 709 67 | 813 68 | 1051 69 | 841 70 | 330 71 | 165 72 | 831 73 | 534 74 | 423 75 | 570 76 | 1001 77 | 780 78 | 170 79 | 946 80 | 882 81 | 352 82 | 642 83 | 1111 84 | 968 85 | 918 86 | 492 87 | 504 88 | 644 89 | 938 90 | 637 91 | 1017 92 | 562 93 | 587 94 | 899 95 | 26 96 | 91 97 | 244 98 | 1006 99 | 154 100 | 81 101 | 146 102 | 229 103 | 389 104 | 6 105 | 66 106 | 817 107 | 68 108 | 234 109 | 49 110 | 806 111 | 584 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-4.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 683 3 | 552 4 | 1095 5 | 61 6 | 574 7 | 410 8 | 1050 9 | 1005 10 | 442 11 | 209 12 | 177 13 | 894 14 | 197 15 | 302 16 | 196 17 | 245 18 | 996 19 | 862 20 | 1025 21 | 987 22 | 877 23 | 473 24 | 682 25 | 664 26 | 276 27 | 653 28 | 485 29 | 1044 30 | 118 31 | 477 32 | 695 33 | 19 34 | 536 35 | 65 36 | 867 37 | 7 38 | 233 39 | 36 40 | 875 41 | 386 42 | 97 43 | 80 44 | 444 45 | 943 46 | 545 47 | 666 48 | 464 49 | 404 50 | 723 51 | 908 52 | 339 53 | 14 54 | 538 55 | 499 56 | 227 57 | 515 58 | 379 59 | 402 60 | 313 61 | 1063 62 | 490 63 | 237 64 | 33 65 | 732 66 | 891 67 | 811 68 | 479 69 | 524 70 | 577 71 | 1040 72 | 510 73 | 128 74 | 799 75 | 133 76 | 1108 77 | 129 78 | 324 79 | 858 80 | 600 81 | 604 82 | 333 83 | 933 84 | 949 85 | 667 86 | 839 87 | 419 88 | 223 89 | 1038 90 | 348 91 | 341 92 | 734 93 | 318 94 | 138 95 | 622 96 | 743 97 | 459 98 | 647 99 | 810 100 | 945 101 | 300 102 | 450 103 | 921 104 | 1021 105 | 825 106 | 703 107 | 670 108 | 169 109 | 1085 110 | 94 111 | 215 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-7.txt: -------------------------------------------------------------------------------- 1 | 744 2 | 1065 3 | 866 4 | 605 5 | 711 6 | 939 7 | 48 8 | 232 9 | 590 10 | 131 11 | 629 12 | 834 13 | 758 14 | 973 15 | 393 16 | 86 17 | 155 18 | 317 19 | 98 20 | 863 21 | 651 22 | 175 23 | 713 24 | 704 25 | 953 26 | 377 27 | 349 28 | 765 29 | 463 30 | 478 31 | 720 32 | 972 33 | 525 34 | 221 35 | 211 36 | 426 37 | 495 38 | 896 39 | 371 40 | 342 41 | 448 42 | 72 43 | 688 44 | 312 45 | 189 46 | 307 47 | 1009 48 | 335 49 | 117 50 | 141 51 | 298 52 | 962 53 | 853 54 | 905 55 | 598 56 | 468 57 | 573 58 | 9 59 | 931 60 | 1045 61 | 530 62 | 316 63 | 246 64 | 284 65 | 119 66 | 610 67 | 161 68 | 185 69 | 793 70 | 673 71 | 497 72 | 340 73 | 786 74 | 1109 75 | 387 76 | 491 77 | 18 78 | 639 79 | 263 80 | 613 81 | 521 82 | 85 83 | 608 84 | 580 85 | 752 86 | 757 87 | 296 88 | 923 89 | 1027 90 | 912 91 | 424 92 | 638 93 | 172 94 | 659 95 | 523 96 | 40 97 | 383 98 | 1023 99 | 1080 100 | 270 101 | 851 102 | 798 103 | 390 104 | 256 105 | 112 106 | 366 107 | 217 108 | 130 109 | 228 110 | 549 111 | 929 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-8.txt: -------------------------------------------------------------------------------- 1 | 92 2 | 738 3 | 413 4 | 914 5 | 483 6 | 158 7 | 728 8 | 649 9 | 721 10 | 179 11 | 895 12 | 979 13 | 266 14 | 201 15 | 420 16 | 1086 17 | 741 18 | 852 19 | 821 20 | 207 21 | 24 22 | 89 23 | 1004 24 | 494 25 | 1042 26 | 1102 27 | 462 28 | 655 29 | 502 30 | 297 31 | 565 32 | 873 33 | 643 34 | 930 35 | 400 36 | 722 37 | 555 38 | 657 39 | 556 40 | 675 41 | 114 42 | 186 43 | 338 44 | 980 45 | 990 46 | 323 47 | 411 48 | 932 49 | 889 50 | 594 51 | 1060 52 | 421 53 | 88 54 | 467 55 | 505 56 | 731 57 | 326 58 | 736 59 | 106 60 | 124 61 | 546 62 | 45 63 | 487 64 | 122 65 | 253 66 | 99 67 | 239 68 | 254 69 | 44 70 | 346 71 | 82 72 | 969 73 | 904 74 | 273 75 | 571 76 | 120 77 | 1069 78 | 471 79 | 394 80 | 292 81 | 998 82 | 480 83 | 1088 84 | 617 85 | 159 86 | 225 87 | 1052 88 | 252 89 | 71 90 | 901 91 | 902 92 | 849 93 | 635 94 | 784 95 | 1072 96 | 251 97 | 29 98 | 775 99 | 385 100 | 430 101 | 295 102 | 168 103 | 417 104 | 136 105 | 856 106 | 441 107 | 178 108 | 735 109 | 75 110 | 96 111 | 579 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-5.txt: -------------------------------------------------------------------------------- 1 | 948 2 | 671 3 | 470 4 | 1 5 | 278 6 | 543 7 | 676 8 | 807 9 | 220 10 | 218 11 | 861 12 | 532 13 | 1081 14 | 809 15 | 984 16 | 878 17 | 150 18 | 612 19 | 803 20 | 641 21 | 380 22 | 392 23 | 407 24 | 1049 25 | 481 26 | 27 27 | 279 28 | 618 29 | 299 30 | 321 31 | 236 32 | 184 33 | 1059 34 | 240 35 | 818 36 | 729 37 | 718 38 | 241 39 | 815 40 | 173 41 | 696 42 | 737 43 | 847 44 | 913 45 | 453 46 | 1100 47 | 1068 48 | 157 49 | 160 50 | 567 51 | 951 52 | 763 53 | 701 54 | 843 55 | 661 56 | 660 57 | 898 58 | 290 59 | 791 60 | 56 61 | 869 62 | 1020 63 | 805 64 | 309 65 | 15 66 | 597 67 | 958 68 | 516 69 | 927 70 | 632 71 | 500 72 | 1037 73 | 354 74 | 174 75 | 794 76 | 997 77 | 235 78 | 717 79 | 733 80 | 406 81 | 623 82 | 62 83 | 654 84 | 249 85 | 745 86 | 257 87 | 28 88 | 8 89 | 41 90 | 568 91 | 576 92 | 1031 93 | 425 94 | 1106 95 | 1083 96 | 838 97 | 142 98 | 616 99 | 103 100 | 456 101 | 167 102 | 513 103 | 435 104 | 697 105 | 482 106 | 820 107 | 961 108 | 648 109 | 1075 110 | 1061 111 | 753 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-9.txt: -------------------------------------------------------------------------------- 1 | 1055 2 | 90 3 | 144 4 | 412 5 | 367 6 | 740 7 | 625 8 | 153 9 | 823 10 | 578 11 | 995 12 | 304 13 | 132 14 | 1039 15 | 956 16 | 288 17 | 547 18 | 166 19 | 110 20 | 105 21 | 561 22 | 345 23 | 588 24 | 1104 25 | 361 26 | 1058 27 | 356 28 | 1036 29 | 511 30 | 1062 31 | 272 32 | 983 33 | 615 34 | 526 35 | 455 36 | 347 37 | 303 38 | 663 39 | 301 40 | 30 41 | 705 42 | 888 43 | 714 44 | 260 45 | 79 46 | 1022 47 | 646 48 | 702 49 | 1018 50 | 602 51 | 429 52 | 993 53 | 677 54 | 764 55 | 231 56 | 469 57 | 808 58 | 748 59 | 650 60 | 472 61 | 730 62 | 507 63 | 964 64 | 924 65 | 486 66 | 1012 67 | 566 68 | 795 69 | 325 70 | 11 71 | 415 72 | 966 73 | 776 74 | 603 75 | 1007 76 | 305 77 | 868 78 | 13 79 | 1078 80 | 503 81 | 860 82 | 977 83 | 994 84 | 689 85 | 750 86 | 767 87 | 621 88 | 311 89 | 802 90 | 126 91 | 226 92 | 1043 93 | 606 94 | 514 95 | 557 96 | 636 97 | 626 98 | 591 99 | 540 100 | 656 101 | 369 102 | 706 103 | 405 104 | 699 105 | 104 106 | 859 107 | 200 108 | 550 109 | 264 110 | 457 111 | 52 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-10.txt: -------------------------------------------------------------------------------- 1 | 437 2 | 589 3 | 645 4 | 58 5 | 710 6 | 20 7 | 370 8 | 634 9 | 631 10 | 835 11 | 1098 12 | 870 13 | 76 14 | 39 15 | 447 16 | 920 17 | 769 18 | 1032 19 | 865 20 | 1066 21 | 864 22 | 344 23 | 978 24 | 1008 25 | 42 26 | 627 27 | 206 28 | 777 29 | 461 30 | 287 31 | 416 32 | 560 33 | 283 34 | 331 35 | 460 36 | 542 37 | 707 38 | 285 39 | 944 40 | 607 41 | 614 42 | 163 43 | 431 44 | 1082 45 | 887 46 | 248 47 | 465 48 | 601 49 | 789 50 | 4 51 | 836 52 | 364 53 | 585 54 | 378 55 | 792 56 | 111 57 | 592 58 | 739 59 | 382 60 | 919 61 | 1071 62 | 1014 63 | 308 64 | 674 65 | 268 66 | 488 67 | 846 68 | 886 69 | 247 70 | 971 71 | 329 72 | 848 73 | 940 74 | 1079 75 | 1090 76 | 517 77 | 1092 78 | 156 79 | 719 80 | 125 81 | 965 82 | 403 83 | 925 84 | 619 85 | 1003 86 | 484 87 | 519 88 | 690 89 | 529 90 | 1046 91 | 475 92 | 937 93 | 586 94 | 219 95 | 381 96 | 564 97 | 357 98 | 778 99 | 212 100 | 620 101 | 384 102 | 22 103 | 985 104 | 362 105 | 1057 106 | 1077 107 | 1053 108 | 64 109 | 1089 110 | 401 111 | 692 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/PROTEINS/test_idx-6.txt: -------------------------------------------------------------------------------- 1 | 452 2 | 900 3 | 512 4 | 712 5 | 572 6 | 907 7 | 779 8 | 70 9 | 306 10 | 967 11 | 782 12 | 446 13 | 988 14 | 398 15 | 672 16 | 694 17 | 265 18 | 787 19 | 724 20 | 771 21 | 1076 22 | 766 23 | 599 24 | 35 25 | 840 26 | 1002 27 | 275 28 | 87 29 | 391 30 | 992 31 | 351 32 | 230 33 | 148 34 | 1097 35 | 187 36 | 715 37 | 917 38 | 1041 39 | 872 40 | 796 41 | 77 42 | 368 43 | 1091 44 | 359 45 | 685 46 | 23 47 | 1099 48 | 269 49 | 1101 50 | 897 51 | 563 52 | 548 53 | 277 54 | 668 55 | 879 56 | 593 57 | 476 58 | 102 59 | 139 60 | 396 61 | 1033 62 | 474 63 | 854 64 | 881 65 | 693 66 | 797 67 | 202 68 | 991 69 | 93 70 | 725 71 | 440 72 | 208 73 | 628 74 | 238 75 | 1087 76 | 1073 77 | 12 78 | 773 79 | 583 80 | 569 81 | 46 82 | 669 83 | 727 84 | 959 85 | 691 86 | 1028 87 | 327 88 | 755 89 | 955 90 | 652 91 | 350 92 | 982 93 | 903 94 | 595 95 | 289 96 | 801 97 | 1096 98 | 934 99 | 558 100 | 928 101 | 121 102 | 395 103 | 397 104 | 1016 105 | 1013 106 | 783 107 | 522 108 | 1048 109 | 509 110 | 790 111 | 496 112 | -------------------------------------------------------------------------------- /experiments/data_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pickle 3 | import torch 4 | import torch.nn.functional as F 5 | import torch_geometric.utils as utils 6 | from gckn.data import PathLoader, S2VGraph 7 | 8 | 9 | def get_adj_list(g): 10 | neighbors = [[] for _ in range(g.num_nodes)] 11 | for k in range(g.edge_index.shape[-1]): 12 | i, j = g.edge_index[:, k] 13 | neighbors[i.item()].append(j.item()) 14 | return neighbors 15 | 16 | def convert_dataset(dataset, n_tags=None): 17 | """Convert a pytorch geometric dataset to gckn dataset 18 | """ 19 | if dataset is None: 20 | return dataset 21 | graph_list = [] 22 | for i, g in enumerate(dataset): 23 | new_g = S2VGraph(g, g.y) 24 | new_g.neighbors = get_adj_list(g) 25 | if n_tags is not None: 26 | new_g.node_features = F.one_hot(g.x.view(-1).long(), n_tags).numpy() 27 | else: 28 | new_g.node_features = g.x.numpy() 29 | degree_list = utils.degree(g.edge_index[0], g.num_nodes).numpy() 30 | new_g.max_neighbor = max(degree_list) 31 | new_g.mean_neighbor = (sum(degree_list) + len(degree_list) - 1) // len(degree_list) 32 | graph_list.append(new_g) 33 | return graph_list 34 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 21 2 | 1 3 | 48 4 | 110 5 | 183 6 | 171 7 | 84 8 | 20 9 | 138 10 | 46 11 | 31 12 | 68 13 | 57 14 | 43 15 | 87 16 | 121 17 | 104 18 | 60 19 | 65 20 | 120 21 | 61 22 | 17 23 | 179 24 | 127 25 | 18 26 | 101 27 | 8 28 | 14 29 | 33 30 | 53 31 | 181 32 | 41 33 | 185 34 | 19 35 | 70 36 | 186 37 | 82 38 | 132 39 | 105 40 | 30 41 | 184 42 | 67 43 | 178 44 | 153 45 | 45 46 | 5 47 | 160 48 | 26 49 | 36 50 | 75 51 | 25 52 | 134 53 | 66 54 | 150 55 | 108 56 | 175 57 | 79 58 | 47 59 | 11 60 | 76 61 | 116 62 | 124 63 | 162 64 | 22 65 | 148 66 | 93 67 | 172 68 | 92 69 | 89 70 | 128 71 | 83 72 | 90 73 | 130 74 | 69 75 | 54 76 | 77 77 | 154 78 | 72 79 | 168 80 | 23 81 | 129 82 | 131 83 | 74 84 | 146 85 | 177 86 | 137 87 | 94 88 | 64 89 | 71 90 | 143 91 | 158 92 | 15 93 | 80 94 | 145 95 | 85 96 | 103 97 | 32 98 | 62 99 | 88 100 | 28 101 | 40 102 | 118 103 | 52 104 | 122 105 | 152 106 | 164 107 | 27 108 | 2 109 | 139 110 | 174 111 | 56 112 | 50 113 | 123 114 | 147 115 | 100 116 | 9 117 | 51 118 | 141 119 | 180 120 | 155 121 | 159 122 | 98 123 | 49 124 | 115 125 | 113 126 | 140 127 | 106 128 | 125 129 | 99 130 | 81 131 | 59 132 | 149 133 | 24 134 | 157 135 | 29 136 | 78 137 | 16 138 | 86 139 | 35 140 | 136 141 | 166 142 | 6 143 | 4 144 | 39 145 | 96 146 | 163 147 | 37 148 | 169 149 | 187 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 44 11 | 7 12 | 133 13 | 151 14 | 34 15 | 97 16 | 73 17 | 21 18 | 1 19 | 48 20 | 110 21 | 183 22 | 84 23 | 20 24 | 42 25 | 10 26 | 138 27 | 46 28 | 31 29 | 68 30 | 43 31 | 87 32 | 121 33 | 63 34 | 19 35 | 70 36 | 186 37 | 82 38 | 132 39 | 105 40 | 30 41 | 184 42 | 67 43 | 178 44 | 153 45 | 173 46 | 45 47 | 5 48 | 160 49 | 36 50 | 75 51 | 25 52 | 134 53 | 66 54 | 12 55 | 108 56 | 175 57 | 79 58 | 47 59 | 11 60 | 76 61 | 116 62 | 124 63 | 162 64 | 22 65 | 148 66 | 93 67 | 172 68 | 92 69 | 107 70 | 89 71 | 128 72 | 90 73 | 69 74 | 54 75 | 77 76 | 72 77 | 168 78 | 23 79 | 129 80 | 131 81 | 146 82 | 177 83 | 112 84 | 137 85 | 94 86 | 64 87 | 176 88 | 143 89 | 158 90 | 15 91 | 80 92 | 145 93 | 85 94 | 103 95 | 32 96 | 62 97 | 88 98 | 28 99 | 40 100 | 52 101 | 122 102 | 152 103 | 164 104 | 27 105 | 2 106 | 156 107 | 139 108 | 174 109 | 50 110 | 111 111 | 123 112 | 147 113 | 9 114 | 51 115 | 102 116 | 142 117 | 141 118 | 180 119 | 155 120 | 98 121 | 49 122 | 165 123 | 115 124 | 113 125 | 140 126 | 106 127 | 125 128 | 99 129 | 81 130 | 55 131 | 59 132 | 149 133 | 24 134 | 157 135 | 29 136 | 3 137 | 16 138 | 86 139 | 35 140 | 136 141 | 166 142 | 6 143 | 4 144 | 39 145 | 96 146 | 163 147 | 37 148 | 13 149 | 169 150 | 187 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 182 3 | 38 4 | 91 5 | 135 6 | 119 7 | 58 8 | 44 9 | 7 10 | 144 11 | 117 12 | 151 13 | 34 14 | 97 15 | 21 16 | 1 17 | 48 18 | 110 19 | 183 20 | 84 21 | 20 22 | 42 23 | 10 24 | 138 25 | 46 26 | 68 27 | 57 28 | 43 29 | 87 30 | 121 31 | 104 32 | 60 33 | 65 34 | 120 35 | 61 36 | 167 37 | 17 38 | 179 39 | 127 40 | 18 41 | 101 42 | 8 43 | 14 44 | 33 45 | 53 46 | 181 47 | 41 48 | 75 49 | 25 50 | 134 51 | 66 52 | 150 53 | 108 54 | 175 55 | 79 56 | 11 57 | 76 58 | 124 59 | 162 60 | 22 61 | 148 62 | 93 63 | 172 64 | 92 65 | 107 66 | 89 67 | 128 68 | 83 69 | 90 70 | 130 71 | 69 72 | 54 73 | 77 74 | 154 75 | 72 76 | 168 77 | 23 78 | 129 79 | 74 80 | 146 81 | 177 82 | 137 83 | 94 84 | 64 85 | 176 86 | 71 87 | 143 88 | 158 89 | 80 90 | 145 91 | 85 92 | 32 93 | 62 94 | 88 95 | 28 96 | 40 97 | 52 98 | 122 99 | 152 100 | 164 101 | 27 102 | 2 103 | 156 104 | 139 105 | 174 106 | 56 107 | 50 108 | 111 109 | 123 110 | 147 111 | 100 112 | 9 113 | 51 114 | 102 115 | 142 116 | 141 117 | 180 118 | 155 119 | 159 120 | 98 121 | 49 122 | 165 123 | 95 124 | 115 125 | 113 126 | 140 127 | 106 128 | 125 129 | 99 130 | 81 131 | 55 132 | 59 133 | 149 134 | 24 135 | 157 136 | 3 137 | 78 138 | 16 139 | 86 140 | 35 141 | 136 142 | 166 143 | 6 144 | 4 145 | 39 146 | 96 147 | 163 148 | 37 149 | 13 150 | 169 151 | 187 152 | 161 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 44 10 | 7 11 | 144 12 | 133 13 | 117 14 | 151 15 | 34 16 | 97 17 | 73 18 | 21 19 | 1 20 | 48 21 | 110 22 | 171 23 | 84 24 | 20 25 | 42 26 | 10 27 | 138 28 | 31 29 | 68 30 | 57 31 | 43 32 | 87 33 | 121 34 | 104 35 | 60 36 | 65 37 | 120 38 | 167 39 | 17 40 | 179 41 | 127 42 | 18 43 | 14 44 | 33 45 | 53 46 | 41 47 | 185 48 | 63 49 | 70 50 | 186 51 | 82 52 | 105 53 | 30 54 | 184 55 | 67 56 | 178 57 | 153 58 | 173 59 | 45 60 | 5 61 | 160 62 | 26 63 | 36 64 | 75 65 | 25 66 | 134 67 | 66 68 | 12 69 | 150 70 | 108 71 | 175 72 | 79 73 | 47 74 | 76 75 | 116 76 | 162 77 | 22 78 | 148 79 | 93 80 | 172 81 | 92 82 | 107 83 | 89 84 | 128 85 | 130 86 | 69 87 | 54 88 | 77 89 | 154 90 | 72 91 | 168 92 | 23 93 | 129 94 | 131 95 | 74 96 | 146 97 | 177 98 | 112 99 | 137 100 | 64 101 | 176 102 | 71 103 | 158 104 | 15 105 | 80 106 | 145 107 | 85 108 | 103 109 | 32 110 | 62 111 | 88 112 | 9 113 | 51 114 | 102 115 | 141 116 | 180 117 | 159 118 | 98 119 | 49 120 | 165 121 | 95 122 | 115 123 | 113 124 | 140 125 | 106 126 | 125 127 | 99 128 | 81 129 | 55 130 | 59 131 | 149 132 | 24 133 | 157 134 | 29 135 | 3 136 | 78 137 | 86 138 | 35 139 | 136 140 | 166 141 | 6 142 | 4 143 | 39 144 | 96 145 | 163 146 | 37 147 | 13 148 | 169 149 | 187 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 135 7 | 119 8 | 58 9 | 44 10 | 7 11 | 144 12 | 117 13 | 151 14 | 34 15 | 73 16 | 21 17 | 1 18 | 48 19 | 183 20 | 171 21 | 84 22 | 20 23 | 42 24 | 10 25 | 138 26 | 46 27 | 31 28 | 68 29 | 57 30 | 43 31 | 87 32 | 121 33 | 104 34 | 60 35 | 65 36 | 120 37 | 61 38 | 167 39 | 17 40 | 179 41 | 127 42 | 18 43 | 8 44 | 14 45 | 53 46 | 181 47 | 41 48 | 185 49 | 63 50 | 19 51 | 70 52 | 186 53 | 82 54 | 132 55 | 105 56 | 30 57 | 184 58 | 178 59 | 153 60 | 5 61 | 160 62 | 26 63 | 36 64 | 75 65 | 25 66 | 134 67 | 66 68 | 12 69 | 108 70 | 175 71 | 47 72 | 11 73 | 76 74 | 116 75 | 124 76 | 162 77 | 22 78 | 148 79 | 93 80 | 172 81 | 92 82 | 89 83 | 128 84 | 83 85 | 90 86 | 69 87 | 54 88 | 77 89 | 154 90 | 72 91 | 168 92 | 23 93 | 129 94 | 131 95 | 74 96 | 146 97 | 177 98 | 112 99 | 137 100 | 94 101 | 64 102 | 176 103 | 71 104 | 143 105 | 158 106 | 15 107 | 80 108 | 145 109 | 85 110 | 103 111 | 62 112 | 88 113 | 28 114 | 40 115 | 118 116 | 52 117 | 122 118 | 152 119 | 164 120 | 27 121 | 2 122 | 156 123 | 139 124 | 174 125 | 56 126 | 50 127 | 111 128 | 123 129 | 147 130 | 100 131 | 81 132 | 55 133 | 59 134 | 157 135 | 29 136 | 3 137 | 78 138 | 16 139 | 86 140 | 35 141 | 136 142 | 166 143 | 6 144 | 39 145 | 96 146 | 163 147 | 37 148 | 13 149 | 169 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /gckn/gckn_fast/gckn_fast_cuda.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // CUDA declarations 4 | 5 | torch::Tensor path_conv_forward_cuda( 6 | torch::Tensor path_indices, 7 | torch::Tensor features); 8 | 9 | void path_conv_backward_cuda( 10 | torch::Tensor d_input, 11 | torch::Tensor d_output, 12 | torch::Tensor path_indices); 13 | 14 | 15 | // C++ interface 16 | 17 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor") 18 | #define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous") 19 | #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x) 20 | 21 | torch::Tensor path_conv_forward( 22 | torch::Tensor path_indices, 23 | torch::Tensor features) { 24 | CHECK_INPUT(path_indices); 25 | CHECK_INPUT(features); 26 | 27 | return path_conv_forward_cuda(path_indices, features); 28 | } 29 | 30 | void path_conv_backward( 31 | torch::Tensor d_input, 32 | torch::Tensor d_output, 33 | torch::Tensor path_indices) { 34 | CHECK_INPUT(path_indices); 35 | CHECK_INPUT(d_input); 36 | CHECK_INPUT(d_output); 37 | 38 | path_conv_backward_cuda(d_input, d_output, path_indices); 39 | } 40 | 41 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { 42 | m.def("path_conv_forward", &path_conv_forward, "path kernel mapping forward (CUDA)"); 43 | m.def("path_conv_backward", &path_conv_backward, "path kernel mapping backward (CUDA)"); 44 | } 45 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 44 11 | 7 12 | 144 13 | 133 14 | 117 15 | 151 16 | 34 17 | 73 18 | 21 19 | 1 20 | 48 21 | 110 22 | 183 23 | 171 24 | 84 25 | 20 26 | 42 27 | 10 28 | 138 29 | 46 30 | 31 31 | 68 32 | 57 33 | 121 34 | 104 35 | 60 36 | 65 37 | 61 38 | 167 39 | 17 40 | 179 41 | 127 42 | 18 43 | 101 44 | 8 45 | 14 46 | 33 47 | 53 48 | 181 49 | 41 50 | 185 51 | 63 52 | 19 53 | 70 54 | 186 55 | 132 56 | 105 57 | 184 58 | 178 59 | 153 60 | 173 61 | 45 62 | 5 63 | 160 64 | 26 65 | 36 66 | 172 67 | 92 68 | 107 69 | 89 70 | 128 71 | 83 72 | 90 73 | 69 74 | 54 75 | 77 76 | 72 77 | 168 78 | 23 79 | 129 80 | 131 81 | 74 82 | 146 83 | 177 84 | 112 85 | 137 86 | 94 87 | 64 88 | 176 89 | 71 90 | 143 91 | 158 92 | 15 93 | 80 94 | 145 95 | 85 96 | 103 97 | 32 98 | 62 99 | 88 100 | 40 101 | 118 102 | 52 103 | 122 104 | 152 105 | 164 106 | 27 107 | 2 108 | 139 109 | 174 110 | 56 111 | 50 112 | 123 113 | 147 114 | 100 115 | 9 116 | 51 117 | 102 118 | 142 119 | 141 120 | 180 121 | 155 122 | 159 123 | 98 124 | 165 125 | 115 126 | 113 127 | 140 128 | 106 129 | 99 130 | 81 131 | 55 132 | 59 133 | 24 134 | 157 135 | 3 136 | 78 137 | 16 138 | 86 139 | 35 140 | 136 141 | 6 142 | 4 143 | 39 144 | 96 145 | 163 146 | 37 147 | 13 148 | 169 149 | 187 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 44 11 | 7 12 | 144 13 | 133 14 | 117 15 | 151 16 | 97 17 | 73 18 | 21 19 | 1 20 | 110 21 | 183 22 | 84 23 | 20 24 | 42 25 | 10 26 | 46 27 | 31 28 | 57 29 | 43 30 | 87 31 | 121 32 | 60 33 | 65 34 | 120 35 | 61 36 | 167 37 | 179 38 | 101 39 | 8 40 | 14 41 | 33 42 | 53 43 | 181 44 | 41 45 | 185 46 | 63 47 | 19 48 | 70 49 | 186 50 | 82 51 | 132 52 | 30 53 | 184 54 | 67 55 | 178 56 | 173 57 | 45 58 | 5 59 | 160 60 | 26 61 | 36 62 | 75 63 | 25 64 | 134 65 | 66 66 | 150 67 | 108 68 | 175 69 | 79 70 | 47 71 | 11 72 | 76 73 | 116 74 | 124 75 | 162 76 | 93 77 | 146 78 | 177 79 | 112 80 | 137 81 | 94 82 | 64 83 | 176 84 | 71 85 | 143 86 | 158 87 | 15 88 | 80 89 | 85 90 | 103 91 | 32 92 | 62 93 | 88 94 | 28 95 | 40 96 | 118 97 | 52 98 | 122 99 | 152 100 | 164 101 | 27 102 | 156 103 | 139 104 | 174 105 | 56 106 | 50 107 | 111 108 | 147 109 | 100 110 | 9 111 | 51 112 | 102 113 | 142 114 | 141 115 | 180 116 | 155 117 | 159 118 | 49 119 | 165 120 | 95 121 | 115 122 | 113 123 | 140 124 | 106 125 | 125 126 | 99 127 | 81 128 | 55 129 | 59 130 | 149 131 | 24 132 | 157 133 | 29 134 | 3 135 | 78 136 | 16 137 | 86 138 | 35 139 | 136 140 | 166 141 | 6 142 | 4 143 | 39 144 | 96 145 | 163 146 | 37 147 | 13 148 | 169 149 | 187 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 38 4 | 170 5 | 91 6 | 135 7 | 119 8 | 58 9 | 44 10 | 144 11 | 151 12 | 34 13 | 97 14 | 21 15 | 48 16 | 110 17 | 183 18 | 171 19 | 20 20 | 10 21 | 138 22 | 46 23 | 57 24 | 43 25 | 87 26 | 121 27 | 104 28 | 60 29 | 120 30 | 61 31 | 17 32 | 179 33 | 127 34 | 18 35 | 101 36 | 8 37 | 14 38 | 33 39 | 53 40 | 181 41 | 41 42 | 185 43 | 19 44 | 70 45 | 186 46 | 82 47 | 105 48 | 30 49 | 184 50 | 67 51 | 178 52 | 153 53 | 173 54 | 45 55 | 5 56 | 160 57 | 26 58 | 75 59 | 25 60 | 134 61 | 66 62 | 12 63 | 150 64 | 108 65 | 175 66 | 79 67 | 47 68 | 11 69 | 76 70 | 116 71 | 124 72 | 162 73 | 22 74 | 148 75 | 93 76 | 172 77 | 92 78 | 107 79 | 89 80 | 128 81 | 83 82 | 90 83 | 130 84 | 69 85 | 54 86 | 77 87 | 154 88 | 72 89 | 168 90 | 23 91 | 129 92 | 131 93 | 74 94 | 28 95 | 40 96 | 118 97 | 52 98 | 122 99 | 152 100 | 164 101 | 27 102 | 2 103 | 156 104 | 139 105 | 56 106 | 50 107 | 111 108 | 123 109 | 100 110 | 9 111 | 51 112 | 102 113 | 142 114 | 141 115 | 180 116 | 155 117 | 159 118 | 98 119 | 49 120 | 165 121 | 95 122 | 115 123 | 113 124 | 140 125 | 106 126 | 125 127 | 99 128 | 81 129 | 55 130 | 59 131 | 149 132 | 24 133 | 157 134 | 3 135 | 78 136 | 16 137 | 86 138 | 35 139 | 136 140 | 166 141 | 6 142 | 4 143 | 39 144 | 96 145 | 163 146 | 37 147 | 13 148 | 169 149 | 187 150 | 114 151 | 161 152 | 0 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 7 11 | 144 12 | 133 13 | 117 14 | 151 15 | 34 16 | 97 17 | 73 18 | 21 19 | 1 20 | 48 21 | 110 22 | 183 23 | 171 24 | 84 25 | 20 26 | 42 27 | 10 28 | 138 29 | 46 30 | 31 31 | 68 32 | 57 33 | 43 34 | 87 35 | 121 36 | 104 37 | 60 38 | 65 39 | 120 40 | 61 41 | 167 42 | 17 43 | 179 44 | 127 45 | 18 46 | 101 47 | 8 48 | 14 49 | 33 50 | 53 51 | 41 52 | 185 53 | 63 54 | 19 55 | 70 56 | 186 57 | 105 58 | 30 59 | 184 60 | 67 61 | 178 62 | 153 63 | 173 64 | 45 65 | 5 66 | 160 67 | 26 68 | 36 69 | 75 70 | 25 71 | 134 72 | 66 73 | 12 74 | 108 75 | 175 76 | 11 77 | 76 78 | 116 79 | 162 80 | 22 81 | 148 82 | 93 83 | 172 84 | 92 85 | 107 86 | 89 87 | 128 88 | 83 89 | 90 90 | 130 91 | 69 92 | 54 93 | 77 94 | 154 95 | 168 96 | 23 97 | 129 98 | 131 99 | 74 100 | 146 101 | 177 102 | 112 103 | 137 104 | 94 105 | 64 106 | 176 107 | 143 108 | 158 109 | 145 110 | 85 111 | 103 112 | 32 113 | 62 114 | 88 115 | 28 116 | 40 117 | 118 118 | 52 119 | 122 120 | 164 121 | 2 122 | 156 123 | 139 124 | 174 125 | 56 126 | 50 127 | 111 128 | 123 129 | 100 130 | 9 131 | 51 132 | 102 133 | 142 134 | 180 135 | 155 136 | 159 137 | 98 138 | 49 139 | 165 140 | 95 141 | 115 142 | 113 143 | 140 144 | 106 145 | 125 146 | 99 147 | 163 148 | 37 149 | 169 150 | 187 151 | 114 152 | 161 153 | -------------------------------------------------------------------------------- /dataset/fold-idx/MUTAG/inner_folds/train_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 109 2 | 126 3 | 182 4 | 38 5 | 170 6 | 91 7 | 135 8 | 119 9 | 58 10 | 44 11 | 7 12 | 144 13 | 133 14 | 117 15 | 151 16 | 34 17 | 97 18 | 73 19 | 104 20 | 60 21 | 120 22 | 61 23 | 167 24 | 17 25 | 179 26 | 127 27 | 18 28 | 101 29 | 8 30 | 33 31 | 53 32 | 181 33 | 41 34 | 185 35 | 63 36 | 19 37 | 70 38 | 186 39 | 82 40 | 105 41 | 30 42 | 184 43 | 67 44 | 153 45 | 173 46 | 45 47 | 5 48 | 160 49 | 26 50 | 36 51 | 75 52 | 25 53 | 134 54 | 66 55 | 12 56 | 150 57 | 108 58 | 175 59 | 47 60 | 11 61 | 76 62 | 116 63 | 124 64 | 162 65 | 148 66 | 93 67 | 172 68 | 92 69 | 107 70 | 89 71 | 83 72 | 130 73 | 69 74 | 77 75 | 154 76 | 72 77 | 168 78 | 23 79 | 129 80 | 131 81 | 74 82 | 146 83 | 177 84 | 112 85 | 137 86 | 94 87 | 64 88 | 176 89 | 71 90 | 143 91 | 158 92 | 15 93 | 80 94 | 145 95 | 85 96 | 103 97 | 32 98 | 62 99 | 28 100 | 40 101 | 118 102 | 52 103 | 122 104 | 152 105 | 164 106 | 27 107 | 2 108 | 156 109 | 174 110 | 50 111 | 111 112 | 123 113 | 147 114 | 100 115 | 9 116 | 51 117 | 102 118 | 142 119 | 141 120 | 180 121 | 155 122 | 159 123 | 98 124 | 49 125 | 165 126 | 95 127 | 115 128 | 113 129 | 140 130 | 106 131 | 125 132 | 99 133 | 81 134 | 55 135 | 59 136 | 149 137 | 24 138 | 157 139 | 29 140 | 3 141 | 78 142 | 86 143 | 35 144 | 136 145 | 166 146 | 6 147 | 4 148 | 39 149 | 96 150 | 13 151 | 169 152 | 161 153 | 0 154 | -------------------------------------------------------------------------------- /gckn/loss.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import torch 3 | from torch import nn 4 | import torch.nn.functional as F 5 | from torch.nn.modules.loss import _Loss 6 | 7 | 8 | class HingeLoss(_Loss): 9 | def __init__(self, nclass=10, weight=None, size_average=None, reduce=None, 10 | reduction='elementwise_mean', pos_weight=None, squared=True): 11 | super(HingeLoss, self).__init__(size_average, reduce, reduction) 12 | self.nclass = nclass 13 | self.squared = squared 14 | self.register_buffer('weight', weight) 15 | self.register_buffer('pos_weight', pos_weight) 16 | 17 | def forward(self, input, target): 18 | if not (target.size(0) == input.size(0)): 19 | raise ValueError( 20 | "Target size ({}) must be the same as input size ({})".format(target.size(), input.size())) 21 | if self.pos_weight is not None: 22 | pos_weight = 1 + (self.pos_weight - 1) * target 23 | target = 2 * F.one_hot(target, num_classes=self.nclass) - 1 24 | target = target.float() 25 | loss = F.relu(1. - target * input) 26 | if self.squared: 27 | loss = 0.5 * loss ** 2 28 | if self.weight is not None: 29 | loss = loss * self.weight 30 | if self.pos_weight is not None: 31 | loss = loss * pos_weight 32 | loss = loss.sum(dim=-1) 33 | if self.reduction == 'none': 34 | return loss 35 | elif self.reduction == 'elementwise_mean': 36 | return loss.mean() 37 | else: 38 | return loss.sum() 39 | 40 | LOSS = { 41 | 'ce': nn.CrossEntropyLoss, 42 | 'hinge': HingeLoss, 43 | } 44 | -------------------------------------------------------------------------------- /scripts/cv_gckn_transformer.sh: -------------------------------------------------------------------------------- 1 | cd ../experiments 2 | cmd="python run_transformer_gckn_cv.py" 3 | cmd_test="python run_transformer_gckn_cv.py --test" 4 | dataset='MUTAG' 5 | outdir="../logs_cv_gckn_trans/" 6 | epochs=300 7 | pos_enc="pstep" 8 | #pos_enc="diffusion" 9 | normalization="sym" 10 | p=1 11 | betas="1.0" 12 | gckn_dims="32" 13 | gckn_paths="5" 14 | gckn_sigmas="0.6" 15 | gckn_pooling="sum" 16 | wd_list="0.01 0.001 0.0001" 17 | nb_heads_list="1 4 8" 18 | nb_layers_list="1 2 3" 19 | dim_hidden_list="32 64 128" 20 | lrs="0.001" 21 | dropout_list="0.0" 22 | folds="1 2 3 4 5 6 7 8 9 10" 23 | 24 | 25 | startjob () { 26 | ${cmd} $1; ${cmd_test} $1 27 | } 28 | 29 | for gckn_path in $gckn_paths; do 30 | for gckn_dim in $gckn_dims; do 31 | for gckn_sigma in $gckn_sigmas; do 32 | for nb_heads in $nb_heads_list; do 33 | for wd in $wd_list; do 34 | for nb_layers in $nb_layers_list; do 35 | for dim_hidden in $dim_hidden_list; do 36 | for lr in $lrs; do 37 | for dropout in $dropout_list; do 38 | for beta in $betas; do 39 | for fold in $folds; do 40 | startjob "--fold-idx ${fold} --weight-decay ${wd} --gckn-sigma ${gckn_sigma} --gckn-path ${gckn_path} --gckn-dim ${gckn_dim} --gckn-pooling ${gckn_pooling} --dataset ${dataset} --outdir ${outdir} --dropout ${dropout} --epochs ${epochs} --nb-heads ${nb_heads} --nb-layers ${nb_layers} --dim-hidden ${dim_hidden} --lr ${lr} --pos-enc ${pos_enc} --p ${p} --beta ${beta} --normalization ${normalization}" 41 | done 42 | done 43 | done 44 | done 45 | done 46 | done 47 | done 48 | done 49 | done 50 | done 51 | done 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | s 2 | cache 3 | tmp 4 | dataset/* 5 | !dataset/fold-idx 6 | logs* 7 | scripts 8 | .DS_Store 9 | *.c 10 | # Byte-compiled / optimized / DLL files 11 | __pycache__/ 12 | *.py[cod] 13 | *$py.class 14 | 15 | # cython files 16 | *.pyc 17 | utils_fast/build/ 18 | 19 | # C extensions 20 | *.so 21 | 22 | # Distribution / packaging 23 | .Python 24 | env/ 25 | build/ 26 | develop-eggs/ 27 | dist/ 28 | downloads/ 29 | eggs/ 30 | .eggs/ 31 | lib/ 32 | lib64/ 33 | parts/ 34 | sdist/ 35 | var/ 36 | *.egg-info/ 37 | .installed.cfg 38 | *.egg 39 | 40 | # PyInstaller 41 | # Usually these files are written by a python script from a template 42 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 43 | *.manifest 44 | *.spec 45 | 46 | # Installer logs 47 | pip-log.txt 48 | pip-delete-this-directory.txt 49 | 50 | # Unit test / coverage reports 51 | htmlcov/ 52 | .tox/ 53 | .coverage 54 | .coverage.* 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | *,cover 59 | .hypothesis/ 60 | 61 | # Translations 62 | *.mo 63 | *.pot 64 | 65 | # Django stuff: 66 | *.log 67 | local_settings.py 68 | 69 | # Flask stuff: 70 | instance/ 71 | .webassets-cache 72 | .DS_Store 73 | # Byte-compiled / optimized / DLL files 74 | # Scrapy stuff: 75 | .scrapy 76 | 77 | # Sphinx documentation 78 | docs/_build/ 79 | 80 | # PyBuilder 81 | target/ 82 | 83 | # IPython Notebook 84 | .ipynb_checkpoints 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # celery beat schedule file 90 | celerybeat-schedule 91 | 92 | # dotenv 93 | .env 94 | 95 | # virtualenv 96 | venv/ 97 | ENV/ 98 | 99 | # Spyder project settings 100 | .spyderproject 101 | 102 | # Rope project settings 103 | .ropeproject 104 | -------------------------------------------------------------------------------- /setup_torch.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import torch 4 | from setuptools import setup 5 | from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension, CUDA_HOME 6 | 7 | if sys.platform == 'win32': 8 | vc_version = os.getenv('VCToolsVersion', '') 9 | if vc_version.startswith('14.16.'): 10 | CXX_FLAGS = ['/sdl'] 11 | else: 12 | CXX_FLAGS = ['/sdl', '/permissive-'] 13 | else: 14 | CXX_FLAGS = ['-g'] 15 | if sys.platform == 'darwin': 16 | os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.11' 17 | else: 18 | CXX_FLAGS.append('-fopenmp') 19 | os.environ["TORCH_CUDA_ARCH_LIST"] = "3.7+PTX;5.0;6.0;6.1;6.2;7.0;7.5" 20 | 21 | ext_modules = [ 22 | CppExtension( 23 | 'gckn.dynamic_pooling.pooling_cpu', ['gckn/dynamic_pooling/pooling.cpp'], 24 | extra_compile_args=CXX_FLAGS), 25 | CppExtension( 26 | 'gckn.gckn_fast.gckn_fast_cpu', ['gckn/gckn_fast/gckn_fast.cpp'], 27 | extra_compile_args=CXX_FLAGS) 28 | ] 29 | 30 | # if torch.cuda.is_available() and CUDA_HOME is not None: 31 | # print(CUDA_HOME) 32 | # extension = [ 33 | # CUDAExtension( 34 | # 'gckn.dynamic_pooling.pooling_cuda', [ 35 | # 'gckn/dynamic_pooling/pooling_cuda.cpp', 36 | # 'gckn/dynamic_pooling/pooling_cuda_kernel.cu' 37 | # ], 38 | # extra_compile_args={'cxx': CXX_FLAGS, 39 | # 'nvcc': ['-O2']}), 40 | # CUDAExtension( 41 | # 'gckn.gckn_fast.gckn_fast_cuda', [ 42 | # 'gckn/gckn_fast/gckn_fast_cuda.cpp', 43 | # 'gckn/gckn_fast/gckn_fast_cuda_kernel.cu' 44 | # ], 45 | # extra_compile_args={'cxx': CXX_FLAGS, 46 | # 'nvcc': ['-O2']}) 47 | # ] 48 | # ext_modules.extend(extension) 49 | 50 | setup( 51 | name='gckn', 52 | ext_modules=ext_modules, 53 | cmdclass={'build_ext': BuildExtension}) 54 | -------------------------------------------------------------------------------- /gckn/ops.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import torch 3 | 4 | 5 | class MatrixInverseSqrt(torch.autograd.Function): 6 | """Matrix inverse square root for a symmetric definite positive matrix 7 | """ 8 | @staticmethod 9 | def forward(ctx, input, eps=1e-2): 10 | dim = input.dim() 11 | ctx.dim = dim 12 | use_cuda = input.is_cuda 13 | if input.size(0) < 300: 14 | input = input.cpu() 15 | e, v = torch.symeig(input, eigenvectors=True) 16 | if use_cuda and input.size(0) < 300: 17 | e = e.cuda() 18 | v = v.cuda() 19 | e = e.clamp(min=0) 20 | e_sqrt = e.sqrt_().add_(eps) 21 | ctx.save_for_backward(e_sqrt, v) 22 | e_rsqrt = e_sqrt.reciprocal() 23 | 24 | if dim > 2: 25 | output = v.bmm(v.permute(0, 2, 1) * e_rsqrt.unsqueeze(-1)) 26 | else: 27 | output = v.mm(v.t() * e_rsqrt.view(-1, 1)) 28 | return output 29 | 30 | @staticmethod 31 | def backward(ctx, grad_output): 32 | e_sqrt, v = ctx.saved_variables 33 | if ctx.dim > 2: 34 | ei = e_sqrt.unsqueeze(1).expand_as(v) 35 | ej = e_sqrt.unsqueeze(-1).expand_as(v) 36 | else: 37 | ei = e_sqrt.expand_as(v) 38 | ej = e_sqrt.view(-1, 1).expand_as(v) 39 | f = torch.reciprocal((ei + ej) * ei * ej) 40 | if ctx.dim > 2: 41 | vt = v.permute(0, 2, 1) 42 | grad_input = -v.bmm((f*(vt.bmm(grad_output.bmm(v)))).bmm(vt)) 43 | else: 44 | grad_input = -v.mm((f*(v.t().mm(grad_output.mm(v)))).mm(v.t())) 45 | return grad_input, None 46 | 47 | 48 | def matrix_inverse_sqrt(input, eps=1e-2): 49 | """Wrapper for MatrixInverseSqrt""" 50 | return MatrixInverseSqrt.apply(input, eps) 51 | 52 | 53 | if __name__ == "__main__": 54 | torch.manual_seed(0) 55 | # x = torch.rand(1, 3, 3) 56 | # x = torch.bmm(x, x.permute(0, 2, 1)) 57 | x = torch.rand(3, 3) 58 | x = torch.mm(x, x.t()) 59 | x.unsqueeze_(0) 60 | x = x.repeat(5, 1, 1) 61 | x.requires_grad_() 62 | out = matrix_inverse_sqrt(x) 63 | print(out) 64 | out = out.sum() 65 | out.backward() 66 | print(x.grad) 67 | -------------------------------------------------------------------------------- /gckn/dynamic_pooling/pooling_cuda.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // CUDA forward declarations 6 | 7 | std::vector dpooling_max_cuda_forward( 8 | torch::Tensor input, 9 | torch::Tensor kernel_size); 10 | 11 | void dpooling_max_cuda_backward( 12 | torch::Tensor d_input, 13 | torch::Tensor d_output, 14 | torch::Tensor indices); 15 | 16 | torch::Tensor dpooling_sum_cuda_forward( 17 | torch::Tensor input, 18 | torch::Tensor kernel_size, 19 | bool mean); 20 | 21 | void dpooling_sum_cuda_backward( 22 | torch::Tensor d_input, 23 | torch::Tensor d_output, 24 | torch::Tensor kernel_size, 25 | bool mean); 26 | 27 | // C++ interface 28 | 29 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor") 30 | #define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous") 31 | #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x) 32 | 33 | std::vector dpooling_max_forward( 34 | torch::Tensor input, 35 | torch::Tensor kernel_size) { 36 | CHECK_INPUT(input); 37 | CHECK_INPUT(kernel_size); 38 | 39 | return dpooling_max_cuda_forward(input, kernel_size); 40 | } 41 | 42 | void dpooling_max_backward( 43 | torch::Tensor d_input, 44 | torch::Tensor d_output, 45 | torch::Tensor indices) { 46 | CHECK_INPUT(d_output); 47 | CHECK_INPUT(d_input); 48 | CHECK_INPUT(indices); 49 | dpooling_max_cuda_backward(d_input, d_output, indices); 50 | } 51 | 52 | torch::Tensor dpooling_sum_forward( 53 | torch::Tensor input, 54 | torch::Tensor kernel_size, 55 | bool mean) { 56 | CHECK_INPUT(input); 57 | CHECK_INPUT(kernel_size); 58 | 59 | return dpooling_sum_cuda_forward(input, kernel_size, mean); 60 | } 61 | 62 | void dpooling_sum_backward( 63 | torch::Tensor d_input, 64 | torch::Tensor d_output, 65 | torch::Tensor kernel_size, 66 | bool mean) { 67 | CHECK_INPUT(d_input); 68 | CHECK_INPUT(d_output); 69 | CHECK_INPUT(kernel_size); 70 | dpooling_sum_cuda_backward(d_input, d_output, kernel_size, mean); 71 | } 72 | 73 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { 74 | m.def("max_forward", &dpooling_max_forward, "dynamic max pooling forward (CUDA)"); 75 | m.def("max_backward", &dpooling_max_backward, "dynamic max pooling backward (CUDA)"); 76 | m.def("sum_forward", &dpooling_sum_forward, "dynamic sum/mean pooling forward (CUDA)"); 77 | m.def("sum_backward", &dpooling_sum_backward, "dynamic sum/mean pooling backward (CUDA)"); 78 | } 79 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 31 2 | 291 3 | 304 4 | 316 5 | 13 6 | 249 7 | 185 8 | 329 9 | 306 10 | 254 11 | 197 12 | 80 13 | 239 14 | 54 15 | 233 16 | 15 17 | 116 18 | 12 19 | 55 20 | 128 21 | 307 22 | 252 23 | 20 24 | 28 25 | 122 26 | 184 27 | 303 28 | 215 29 | 305 30 | 325 31 | 140 32 | 295 33 | 225 34 | 172 35 | 97 36 | 33 37 | 271 38 | 142 39 | 90 40 | 202 41 | 124 42 | 278 43 | 36 44 | 96 45 | 154 46 | 49 47 | 199 48 | 159 49 | 39 50 | 79 51 | 126 52 | 0 53 | 214 54 | 320 55 | 81 56 | 310 57 | 129 58 | 92 59 | 37 60 | 6 61 | 53 62 | 160 63 | 245 64 | 65 65 | 112 66 | 73 67 | 228 68 | 212 69 | 120 70 | 43 71 | 196 72 | 149 73 | 205 74 | 300 75 | 178 76 | 21 77 | 224 78 | 34 79 | 192 80 | 207 81 | 221 82 | 241 83 | 68 84 | 151 85 | 4 86 | 1 87 | 56 88 | 77 89 | 213 90 | 109 91 | 52 92 | 134 93 | 29 94 | 217 95 | 230 96 | 82 97 | 210 98 | 203 99 | 315 100 | 84 101 | 146 102 | 22 103 | 110 104 | 108 105 | 59 106 | 114 107 | 118 108 | 164 109 | 269 110 | 293 111 | 191 112 | 302 113 | 317 114 | 253 115 | 251 116 | 272 117 | 313 118 | 343 119 | 236 120 | 86 121 | 195 122 | 188 123 | 268 124 | 189 125 | 72 126 | 246 127 | 314 128 | 311 129 | 157 130 | 166 131 | 133 132 | 296 133 | 257 134 | 17 135 | 322 136 | 332 137 | 274 138 | 131 139 | 289 140 | 156 141 | 260 142 | 44 143 | 277 144 | 198 145 | 238 146 | 32 147 | 50 148 | 58 149 | 104 150 | 144 151 | 121 152 | 75 153 | 266 154 | 155 155 | 299 156 | 38 157 | 331 158 | 281 159 | 180 160 | 297 161 | 309 162 | 88 163 | 165 164 | 135 165 | 26 166 | 163 167 | 167 168 | 136 169 | 67 170 | 282 171 | 147 172 | 150 173 | 8 174 | 279 175 | 11 176 | 98 177 | 19 178 | 229 179 | 193 180 | 93 181 | 102 182 | 91 183 | 250 184 | 137 185 | 132 186 | 208 187 | 204 188 | 94 189 | 312 190 | 60 191 | 186 192 | 259 193 | 10 194 | 61 195 | 7 196 | 141 197 | 70 198 | 169 199 | 117 200 | 335 201 | 42 202 | 206 203 | 336 204 | 123 205 | 276 206 | 194 207 | 201 208 | 223 209 | 179 210 | 127 211 | 232 212 | 286 213 | 220 214 | 111 215 | 148 216 | 181 217 | 76 218 | 101 219 | 113 220 | 342 221 | 244 222 | 226 223 | 222 224 | 261 225 | 48 226 | 69 227 | 216 228 | 40 229 | 153 230 | 231 231 | 152 232 | 99 233 | 294 234 | 275 235 | 256 236 | 318 237 | 25 238 | 338 239 | 190 240 | 234 241 | 292 242 | 265 243 | 158 244 | 319 245 | 85 246 | 262 247 | 47 248 | 18 249 | 237 250 | 218 251 | 284 252 | 273 253 | 46 254 | 106 255 | 125 256 | 288 257 | 258 258 | 334 259 | 182 260 | 339 261 | 162 262 | 3 263 | 87 264 | 139 265 | 326 266 | 227 267 | 89 268 | 71 269 | 183 270 | 23 271 | 285 272 | 41 273 | 5 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 308 12 | 301 13 | 333 14 | 255 15 | 337 16 | 175 17 | 95 18 | 64 19 | 327 20 | 280 21 | 247 22 | 130 23 | 187 24 | 57 25 | 74 26 | 173 27 | 45 28 | 174 29 | 248 30 | 161 31 | 143 32 | 31 33 | 291 34 | 304 35 | 316 36 | 13 37 | 249 38 | 185 39 | 329 40 | 306 41 | 254 42 | 197 43 | 80 44 | 239 45 | 24 46 | 54 47 | 330 48 | 233 49 | 15 50 | 116 51 | 55 52 | 307 53 | 28 54 | 122 55 | 303 56 | 240 57 | 305 58 | 325 59 | 321 60 | 140 61 | 225 62 | 172 63 | 33 64 | 271 65 | 142 66 | 90 67 | 202 68 | 124 69 | 278 70 | 36 71 | 96 72 | 154 73 | 49 74 | 199 75 | 159 76 | 39 77 | 79 78 | 126 79 | 214 80 | 320 81 | 81 82 | 310 83 | 129 84 | 92 85 | 37 86 | 53 87 | 160 88 | 245 89 | 73 90 | 228 91 | 212 92 | 120 93 | 43 94 | 100 95 | 196 96 | 149 97 | 205 98 | 300 99 | 178 100 | 21 101 | 27 102 | 224 103 | 34 104 | 105 105 | 219 106 | 207 107 | 221 108 | 176 109 | 241 110 | 151 111 | 324 112 | 4 113 | 1 114 | 77 115 | 213 116 | 109 117 | 52 118 | 188 119 | 83 120 | 268 121 | 189 122 | 66 123 | 72 124 | 246 125 | 314 126 | 311 127 | 9 128 | 157 129 | 168 130 | 166 131 | 133 132 | 2 133 | 296 134 | 257 135 | 17 136 | 322 137 | 274 138 | 131 139 | 289 140 | 287 141 | 156 142 | 260 143 | 35 144 | 44 145 | 277 146 | 198 147 | 238 148 | 32 149 | 50 150 | 58 151 | 104 152 | 144 153 | 121 154 | 75 155 | 266 156 | 155 157 | 38 158 | 331 159 | 180 160 | 297 161 | 309 162 | 138 163 | 88 164 | 62 165 | 165 166 | 323 167 | 135 168 | 26 169 | 163 170 | 167 171 | 136 172 | 67 173 | 282 174 | 150 175 | 8 176 | 279 177 | 11 178 | 98 179 | 19 180 | 229 181 | 193 182 | 93 183 | 102 184 | 91 185 | 250 186 | 137 187 | 132 188 | 208 189 | 204 190 | 94 191 | 312 192 | 60 193 | 186 194 | 259 195 | 10 196 | 61 197 | 7 198 | 209 199 | 141 200 | 70 201 | 169 202 | 117 203 | 335 204 | 283 205 | 42 206 | 206 207 | 336 208 | 123 209 | 194 210 | 242 211 | 201 212 | 223 213 | 179 214 | 127 215 | 232 216 | 286 217 | 220 218 | 111 219 | 148 220 | 76 221 | 101 222 | 113 223 | 342 224 | 244 225 | 270 226 | 222 227 | 261 228 | 48 229 | 69 230 | 216 231 | 40 232 | 243 233 | 153 234 | 231 235 | 152 236 | 99 237 | 294 238 | 256 239 | 318 240 | 341 241 | 338 242 | 234 243 | 292 244 | 265 245 | 158 246 | 319 247 | 85 248 | 47 249 | 18 250 | 237 251 | 218 252 | 284 253 | 273 254 | 46 255 | 106 256 | 125 257 | 288 258 | 334 259 | 339 260 | 162 261 | 3 262 | 87 263 | 139 264 | 326 265 | 227 266 | 89 267 | 71 268 | 183 269 | 23 270 | 285 271 | 41 272 | 5 273 | 340 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 211 5 | 51 6 | 298 7 | 16 8 | 63 9 | 115 10 | 308 11 | 200 12 | 301 13 | 333 14 | 255 15 | 337 16 | 175 17 | 95 18 | 64 19 | 327 20 | 280 21 | 247 22 | 78 23 | 130 24 | 187 25 | 57 26 | 173 27 | 45 28 | 161 29 | 143 30 | 31 31 | 291 32 | 304 33 | 316 34 | 13 35 | 249 36 | 185 37 | 329 38 | 306 39 | 197 40 | 119 41 | 80 42 | 239 43 | 24 44 | 54 45 | 330 46 | 233 47 | 15 48 | 116 49 | 55 50 | 128 51 | 307 52 | 252 53 | 28 54 | 184 55 | 303 56 | 215 57 | 240 58 | 305 59 | 140 60 | 295 61 | 225 62 | 172 63 | 97 64 | 33 65 | 271 66 | 142 67 | 90 68 | 202 69 | 124 70 | 278 71 | 96 72 | 154 73 | 49 74 | 199 75 | 159 76 | 39 77 | 79 78 | 126 79 | 0 80 | 214 81 | 320 82 | 81 83 | 310 84 | 92 85 | 37 86 | 6 87 | 53 88 | 160 89 | 245 90 | 65 91 | 112 92 | 73 93 | 228 94 | 212 95 | 120 96 | 43 97 | 100 98 | 196 99 | 149 100 | 205 101 | 300 102 | 21 103 | 27 104 | 224 105 | 34 106 | 105 107 | 219 108 | 192 109 | 207 110 | 221 111 | 176 112 | 241 113 | 68 114 | 151 115 | 324 116 | 4 117 | 56 118 | 77 119 | 213 120 | 109 121 | 52 122 | 134 123 | 29 124 | 217 125 | 230 126 | 82 127 | 210 128 | 315 129 | 177 130 | 145 131 | 84 132 | 146 133 | 110 134 | 59 135 | 118 136 | 164 137 | 269 138 | 30 139 | 293 140 | 191 141 | 302 142 | 317 143 | 253 144 | 251 145 | 272 146 | 343 147 | 236 148 | 86 149 | 195 150 | 170 151 | 104 152 | 144 153 | 121 154 | 75 155 | 266 156 | 155 157 | 299 158 | 38 159 | 281 160 | 180 161 | 297 162 | 138 163 | 88 164 | 62 165 | 165 166 | 323 167 | 135 168 | 26 169 | 163 170 | 167 171 | 136 172 | 67 173 | 282 174 | 150 175 | 8 176 | 279 177 | 11 178 | 98 179 | 19 180 | 193 181 | 93 182 | 102 183 | 91 184 | 250 185 | 132 186 | 208 187 | 204 188 | 94 189 | 60 190 | 186 191 | 259 192 | 10 193 | 61 194 | 7 195 | 209 196 | 141 197 | 70 198 | 169 199 | 117 200 | 335 201 | 283 202 | 42 203 | 206 204 | 336 205 | 123 206 | 276 207 | 194 208 | 242 209 | 223 210 | 179 211 | 127 212 | 232 213 | 286 214 | 220 215 | 111 216 | 148 217 | 181 218 | 76 219 | 101 220 | 113 221 | 342 222 | 244 223 | 226 224 | 270 225 | 222 226 | 261 227 | 48 228 | 69 229 | 216 230 | 40 231 | 243 232 | 153 233 | 231 234 | 152 235 | 99 236 | 294 237 | 275 238 | 256 239 | 318 240 | 341 241 | 338 242 | 190 243 | 265 244 | 158 245 | 319 246 | 85 247 | 262 248 | 47 249 | 18 250 | 237 251 | 218 252 | 284 253 | 273 254 | 46 255 | 106 256 | 125 257 | 288 258 | 258 259 | 334 260 | 339 261 | 162 262 | 3 263 | 87 264 | 326 265 | 227 266 | 89 267 | 71 268 | 183 269 | 23 270 | 285 271 | 41 272 | 5 273 | 340 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 290 4 | 51 5 | 298 6 | 63 7 | 115 8 | 308 9 | 200 10 | 301 11 | 255 12 | 337 13 | 95 14 | 64 15 | 327 16 | 280 17 | 247 18 | 130 19 | 187 20 | 57 21 | 74 22 | 173 23 | 45 24 | 174 25 | 248 26 | 161 27 | 143 28 | 31 29 | 291 30 | 304 31 | 316 32 | 249 33 | 185 34 | 329 35 | 306 36 | 254 37 | 197 38 | 119 39 | 80 40 | 239 41 | 54 42 | 330 43 | 233 44 | 15 45 | 116 46 | 12 47 | 55 48 | 128 49 | 307 50 | 252 51 | 28 52 | 122 53 | 184 54 | 303 55 | 215 56 | 240 57 | 325 58 | 321 59 | 140 60 | 295 61 | 225 62 | 172 63 | 97 64 | 33 65 | 271 66 | 142 67 | 90 68 | 202 69 | 124 70 | 278 71 | 36 72 | 96 73 | 154 74 | 49 75 | 199 76 | 159 77 | 79 78 | 126 79 | 0 80 | 214 81 | 320 82 | 81 83 | 129 84 | 37 85 | 6 86 | 53 87 | 160 88 | 245 89 | 65 90 | 112 91 | 228 92 | 212 93 | 120 94 | 43 95 | 100 96 | 196 97 | 149 98 | 300 99 | 178 100 | 21 101 | 27 102 | 224 103 | 34 104 | 105 105 | 219 106 | 192 107 | 207 108 | 221 109 | 176 110 | 241 111 | 68 112 | 151 113 | 324 114 | 4 115 | 1 116 | 56 117 | 213 118 | 109 119 | 52 120 | 29 121 | 217 122 | 230 123 | 82 124 | 210 125 | 203 126 | 315 127 | 177 128 | 145 129 | 84 130 | 146 131 | 22 132 | 110 133 | 108 134 | 59 135 | 114 136 | 118 137 | 164 138 | 269 139 | 30 140 | 293 141 | 191 142 | 302 143 | 317 144 | 253 145 | 251 146 | 313 147 | 343 148 | 236 149 | 86 150 | 195 151 | 170 152 | 188 153 | 268 154 | 189 155 | 66 156 | 72 157 | 246 158 | 314 159 | 311 160 | 9 161 | 157 162 | 166 163 | 133 164 | 2 165 | 296 166 | 257 167 | 17 168 | 322 169 | 131 170 | 289 171 | 287 172 | 156 173 | 260 174 | 35 175 | 44 176 | 277 177 | 198 178 | 238 179 | 32 180 | 50 181 | 58 182 | 104 183 | 144 184 | 121 185 | 266 186 | 155 187 | 299 188 | 38 189 | 331 190 | 281 191 | 180 192 | 297 193 | 309 194 | 138 195 | 88 196 | 62 197 | 323 198 | 135 199 | 26 200 | 163 201 | 167 202 | 136 203 | 67 204 | 282 205 | 147 206 | 150 207 | 8 208 | 279 209 | 11 210 | 98 211 | 19 212 | 229 213 | 193 214 | 232 215 | 286 216 | 220 217 | 111 218 | 148 219 | 181 220 | 76 221 | 101 222 | 342 223 | 244 224 | 226 225 | 270 226 | 222 227 | 261 228 | 48 229 | 69 230 | 216 231 | 40 232 | 243 233 | 153 234 | 231 235 | 99 236 | 294 237 | 318 238 | 25 239 | 341 240 | 190 241 | 234 242 | 292 243 | 265 244 | 158 245 | 319 246 | 85 247 | 262 248 | 47 249 | 18 250 | 237 251 | 218 252 | 284 253 | 273 254 | 46 255 | 106 256 | 125 257 | 288 258 | 258 259 | 334 260 | 182 261 | 339 262 | 162 263 | 3 264 | 87 265 | 139 266 | 227 267 | 89 268 | 71 269 | 183 270 | 23 271 | 41 272 | 5 273 | 340 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 107 2 | 103 3 | 290 4 | 211 5 | 51 6 | 16 7 | 63 8 | 115 9 | 308 10 | 200 11 | 301 12 | 333 13 | 255 14 | 337 15 | 175 16 | 95 17 | 64 18 | 327 19 | 280 20 | 247 21 | 130 22 | 187 23 | 57 24 | 74 25 | 328 26 | 173 27 | 45 28 | 174 29 | 248 30 | 161 31 | 143 32 | 31 33 | 291 34 | 304 35 | 316 36 | 13 37 | 185 38 | 329 39 | 306 40 | 254 41 | 197 42 | 119 43 | 239 44 | 24 45 | 54 46 | 233 47 | 15 48 | 116 49 | 12 50 | 128 51 | 307 52 | 20 53 | 28 54 | 122 55 | 303 56 | 215 57 | 305 58 | 325 59 | 321 60 | 295 61 | 225 62 | 172 63 | 97 64 | 33 65 | 271 66 | 142 67 | 90 68 | 202 69 | 124 70 | 278 71 | 36 72 | 96 73 | 154 74 | 199 75 | 159 76 | 39 77 | 79 78 | 126 79 | 0 80 | 214 81 | 320 82 | 310 83 | 129 84 | 92 85 | 37 86 | 6 87 | 53 88 | 160 89 | 245 90 | 65 91 | 112 92 | 73 93 | 228 94 | 212 95 | 120 96 | 43 97 | 100 98 | 196 99 | 149 100 | 300 101 | 21 102 | 27 103 | 224 104 | 34 105 | 105 106 | 219 107 | 192 108 | 221 109 | 176 110 | 241 111 | 68 112 | 151 113 | 324 114 | 1 115 | 77 116 | 213 117 | 109 118 | 134 119 | 29 120 | 217 121 | 230 122 | 82 123 | 210 124 | 203 125 | 315 126 | 177 127 | 145 128 | 84 129 | 22 130 | 110 131 | 108 132 | 59 133 | 114 134 | 164 135 | 269 136 | 30 137 | 293 138 | 191 139 | 302 140 | 317 141 | 253 142 | 251 143 | 272 144 | 343 145 | 236 146 | 86 147 | 195 148 | 170 149 | 188 150 | 83 151 | 268 152 | 189 153 | 66 154 | 72 155 | 246 156 | 314 157 | 311 158 | 9 159 | 157 160 | 168 161 | 166 162 | 133 163 | 2 164 | 296 165 | 257 166 | 322 167 | 332 168 | 274 169 | 131 170 | 289 171 | 287 172 | 260 173 | 35 174 | 44 175 | 277 176 | 198 177 | 238 178 | 32 179 | 50 180 | 58 181 | 104 182 | 144 183 | 121 184 | 75 185 | 266 186 | 155 187 | 299 188 | 331 189 | 281 190 | 180 191 | 297 192 | 309 193 | 138 194 | 88 195 | 62 196 | 165 197 | 323 198 | 135 199 | 26 200 | 163 201 | 167 202 | 136 203 | 282 204 | 147 205 | 8 206 | 279 207 | 11 208 | 98 209 | 19 210 | 229 211 | 193 212 | 93 213 | 102 214 | 91 215 | 250 216 | 137 217 | 132 218 | 208 219 | 204 220 | 94 221 | 60 222 | 186 223 | 10 224 | 61 225 | 7 226 | 209 227 | 141 228 | 70 229 | 117 230 | 335 231 | 283 232 | 42 233 | 206 234 | 336 235 | 123 236 | 276 237 | 194 238 | 242 239 | 201 240 | 223 241 | 179 242 | 127 243 | 265 244 | 158 245 | 319 246 | 85 247 | 262 248 | 47 249 | 18 250 | 237 251 | 218 252 | 284 253 | 46 254 | 106 255 | 125 256 | 288 257 | 258 258 | 334 259 | 182 260 | 162 261 | 3 262 | 87 263 | 139 264 | 326 265 | 227 266 | 89 267 | 71 268 | 183 269 | 23 270 | 285 271 | 41 272 | 5 273 | 340 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 290 4 | 211 5 | 298 6 | 16 7 | 63 8 | 115 9 | 308 10 | 200 11 | 301 12 | 333 13 | 255 14 | 337 15 | 175 16 | 95 17 | 64 18 | 327 19 | 280 20 | 247 21 | 78 22 | 130 23 | 187 24 | 57 25 | 74 26 | 328 27 | 173 28 | 45 29 | 174 30 | 248 31 | 161 32 | 143 33 | 321 34 | 140 35 | 225 36 | 172 37 | 97 38 | 33 39 | 271 40 | 142 41 | 90 42 | 202 43 | 124 44 | 278 45 | 36 46 | 96 47 | 154 48 | 49 49 | 199 50 | 159 51 | 39 52 | 79 53 | 126 54 | 0 55 | 214 56 | 320 57 | 81 58 | 310 59 | 92 60 | 6 61 | 53 62 | 160 63 | 245 64 | 65 65 | 112 66 | 73 67 | 228 68 | 212 69 | 120 70 | 43 71 | 100 72 | 196 73 | 149 74 | 205 75 | 300 76 | 178 77 | 21 78 | 224 79 | 105 80 | 219 81 | 192 82 | 221 83 | 176 84 | 241 85 | 68 86 | 151 87 | 324 88 | 4 89 | 1 90 | 56 91 | 77 92 | 213 93 | 109 94 | 52 95 | 134 96 | 29 97 | 217 98 | 82 99 | 210 100 | 203 101 | 315 102 | 145 103 | 84 104 | 146 105 | 22 106 | 110 107 | 108 108 | 59 109 | 114 110 | 118 111 | 269 112 | 293 113 | 191 114 | 302 115 | 317 116 | 253 117 | 251 118 | 343 119 | 236 120 | 86 121 | 195 122 | 170 123 | 188 124 | 83 125 | 66 126 | 72 127 | 246 128 | 314 129 | 311 130 | 9 131 | 157 132 | 168 133 | 166 134 | 133 135 | 296 136 | 257 137 | 17 138 | 322 139 | 332 140 | 274 141 | 131 142 | 287 143 | 156 144 | 260 145 | 44 146 | 277 147 | 198 148 | 238 149 | 32 150 | 50 151 | 58 152 | 104 153 | 144 154 | 121 155 | 75 156 | 266 157 | 299 158 | 38 159 | 331 160 | 281 161 | 180 162 | 297 163 | 138 164 | 88 165 | 62 166 | 165 167 | 323 168 | 135 169 | 26 170 | 163 171 | 167 172 | 136 173 | 67 174 | 282 175 | 147 176 | 150 177 | 8 178 | 279 179 | 11 180 | 98 181 | 19 182 | 193 183 | 93 184 | 102 185 | 250 186 | 137 187 | 132 188 | 208 189 | 204 190 | 312 191 | 186 192 | 259 193 | 10 194 | 61 195 | 7 196 | 209 197 | 141 198 | 70 199 | 169 200 | 117 201 | 335 202 | 283 203 | 42 204 | 206 205 | 336 206 | 123 207 | 276 208 | 194 209 | 242 210 | 201 211 | 223 212 | 179 213 | 127 214 | 232 215 | 286 216 | 220 217 | 111 218 | 148 219 | 181 220 | 101 221 | 113 222 | 342 223 | 244 224 | 270 225 | 222 226 | 261 227 | 48 228 | 69 229 | 216 230 | 40 231 | 243 232 | 153 233 | 231 234 | 152 235 | 99 236 | 294 237 | 275 238 | 256 239 | 318 240 | 25 241 | 341 242 | 338 243 | 190 244 | 234 245 | 292 246 | 265 247 | 158 248 | 319 249 | 85 250 | 262 251 | 47 252 | 18 253 | 218 254 | 284 255 | 273 256 | 46 257 | 125 258 | 288 259 | 258 260 | 334 261 | 182 262 | 339 263 | 3 264 | 87 265 | 139 266 | 326 267 | 227 268 | 89 269 | 71 270 | 183 271 | 23 272 | 41 273 | 5 274 | 340 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 200 12 | 301 13 | 333 14 | 255 15 | 337 16 | 175 17 | 95 18 | 64 19 | 327 20 | 247 21 | 78 22 | 130 23 | 187 24 | 57 25 | 74 26 | 328 27 | 173 28 | 45 29 | 174 30 | 248 31 | 143 32 | 31 33 | 291 34 | 304 35 | 316 36 | 249 37 | 185 38 | 329 39 | 306 40 | 254 41 | 197 42 | 119 43 | 80 44 | 239 45 | 24 46 | 330 47 | 233 48 | 12 49 | 55 50 | 128 51 | 252 52 | 28 53 | 122 54 | 184 55 | 303 56 | 215 57 | 240 58 | 325 59 | 65 60 | 112 61 | 73 62 | 228 63 | 120 64 | 43 65 | 100 66 | 196 67 | 149 68 | 205 69 | 300 70 | 178 71 | 21 72 | 27 73 | 224 74 | 105 75 | 219 76 | 192 77 | 207 78 | 221 79 | 176 80 | 241 81 | 68 82 | 151 83 | 324 84 | 4 85 | 1 86 | 56 87 | 213 88 | 109 89 | 52 90 | 134 91 | 29 92 | 217 93 | 230 94 | 82 95 | 210 96 | 203 97 | 315 98 | 177 99 | 145 100 | 84 101 | 146 102 | 22 103 | 108 104 | 59 105 | 164 106 | 269 107 | 30 108 | 293 109 | 191 110 | 302 111 | 317 112 | 253 113 | 251 114 | 272 115 | 313 116 | 343 117 | 236 118 | 86 119 | 195 120 | 170 121 | 188 122 | 83 123 | 268 124 | 189 125 | 66 126 | 72 127 | 314 128 | 311 129 | 9 130 | 157 131 | 168 132 | 166 133 | 2 134 | 296 135 | 257 136 | 17 137 | 322 138 | 332 139 | 274 140 | 131 141 | 289 142 | 156 143 | 260 144 | 35 145 | 44 146 | 198 147 | 238 148 | 50 149 | 58 150 | 104 151 | 144 152 | 121 153 | 75 154 | 266 155 | 155 156 | 299 157 | 38 158 | 331 159 | 281 160 | 180 161 | 297 162 | 309 163 | 138 164 | 88 165 | 62 166 | 323 167 | 135 168 | 26 169 | 163 170 | 167 171 | 136 172 | 67 173 | 282 174 | 147 175 | 150 176 | 8 177 | 279 178 | 11 179 | 98 180 | 19 181 | 229 182 | 193 183 | 93 184 | 102 185 | 91 186 | 250 187 | 137 188 | 132 189 | 208 190 | 204 191 | 94 192 | 312 193 | 60 194 | 186 195 | 259 196 | 10 197 | 61 198 | 7 199 | 141 200 | 70 201 | 169 202 | 117 203 | 335 204 | 283 205 | 42 206 | 336 207 | 123 208 | 276 209 | 194 210 | 242 211 | 201 212 | 223 213 | 179 214 | 127 215 | 286 216 | 220 217 | 111 218 | 181 219 | 101 220 | 113 221 | 342 222 | 244 223 | 226 224 | 270 225 | 48 226 | 69 227 | 216 228 | 40 229 | 243 230 | 153 231 | 231 232 | 152 233 | 99 234 | 294 235 | 275 236 | 256 237 | 318 238 | 25 239 | 341 240 | 190 241 | 234 242 | 292 243 | 158 244 | 319 245 | 85 246 | 262 247 | 47 248 | 18 249 | 237 250 | 218 251 | 284 252 | 273 253 | 46 254 | 106 255 | 125 256 | 288 257 | 258 258 | 334 259 | 182 260 | 339 261 | 162 262 | 3 263 | 87 264 | 139 265 | 227 266 | 89 267 | 71 268 | 183 269 | 23 270 | 285 271 | 41 272 | 5 273 | 340 274 | 263 275 | 235 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 308 12 | 301 13 | 333 14 | 255 15 | 337 16 | 64 17 | 327 18 | 280 19 | 247 20 | 78 21 | 130 22 | 57 23 | 74 24 | 328 25 | 173 26 | 45 27 | 174 28 | 248 29 | 161 30 | 143 31 | 31 32 | 304 33 | 316 34 | 13 35 | 249 36 | 185 37 | 329 38 | 306 39 | 254 40 | 197 41 | 80 42 | 24 43 | 54 44 | 233 45 | 15 46 | 116 47 | 12 48 | 55 49 | 128 50 | 252 51 | 20 52 | 28 53 | 122 54 | 184 55 | 303 56 | 215 57 | 240 58 | 321 59 | 140 60 | 295 61 | 225 62 | 172 63 | 33 64 | 142 65 | 90 66 | 202 67 | 124 68 | 278 69 | 36 70 | 96 71 | 154 72 | 49 73 | 199 74 | 159 75 | 39 76 | 79 77 | 126 78 | 214 79 | 320 80 | 81 81 | 310 82 | 129 83 | 92 84 | 37 85 | 6 86 | 53 87 | 160 88 | 245 89 | 134 90 | 217 91 | 230 92 | 82 93 | 210 94 | 315 95 | 177 96 | 145 97 | 146 98 | 22 99 | 110 100 | 108 101 | 59 102 | 118 103 | 164 104 | 269 105 | 30 106 | 293 107 | 191 108 | 302 109 | 317 110 | 253 111 | 251 112 | 272 113 | 313 114 | 343 115 | 236 116 | 86 117 | 195 118 | 170 119 | 188 120 | 83 121 | 268 122 | 189 123 | 66 124 | 72 125 | 246 126 | 314 127 | 311 128 | 9 129 | 157 130 | 168 131 | 166 132 | 133 133 | 2 134 | 296 135 | 257 136 | 17 137 | 322 138 | 332 139 | 274 140 | 131 141 | 289 142 | 287 143 | 156 144 | 260 145 | 35 146 | 44 147 | 277 148 | 198 149 | 238 150 | 50 151 | 58 152 | 104 153 | 144 154 | 121 155 | 75 156 | 266 157 | 155 158 | 299 159 | 38 160 | 281 161 | 180 162 | 297 163 | 309 164 | 138 165 | 88 166 | 62 167 | 165 168 | 135 169 | 26 170 | 163 171 | 167 172 | 136 173 | 67 174 | 282 175 | 147 176 | 150 177 | 8 178 | 279 179 | 98 180 | 19 181 | 229 182 | 193 183 | 93 184 | 102 185 | 91 186 | 250 187 | 137 188 | 132 189 | 208 190 | 204 191 | 94 192 | 312 193 | 60 194 | 186 195 | 259 196 | 10 197 | 61 198 | 7 199 | 209 200 | 141 201 | 70 202 | 117 203 | 335 204 | 283 205 | 42 206 | 206 207 | 336 208 | 123 209 | 276 210 | 194 211 | 242 212 | 201 213 | 223 214 | 179 215 | 127 216 | 232 217 | 286 218 | 220 219 | 181 220 | 76 221 | 101 222 | 113 223 | 342 224 | 226 225 | 270 226 | 261 227 | 48 228 | 69 229 | 216 230 | 40 231 | 243 232 | 153 233 | 231 234 | 152 235 | 99 236 | 294 237 | 275 238 | 256 239 | 318 240 | 25 241 | 341 242 | 338 243 | 190 244 | 234 245 | 265 246 | 158 247 | 319 248 | 262 249 | 47 250 | 18 251 | 237 252 | 218 253 | 284 254 | 273 255 | 46 256 | 106 257 | 125 258 | 288 259 | 258 260 | 334 261 | 182 262 | 339 263 | 162 264 | 3 265 | 87 266 | 139 267 | 326 268 | 227 269 | 89 270 | 71 271 | 183 272 | 285 273 | 41 274 | 340 275 | 263 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 308 12 | 301 13 | 333 14 | 255 15 | 337 16 | 175 17 | 95 18 | 64 19 | 327 20 | 280 21 | 247 22 | 78 23 | 130 24 | 187 25 | 57 26 | 74 27 | 328 28 | 173 29 | 248 30 | 161 31 | 143 32 | 31 33 | 291 34 | 304 35 | 316 36 | 13 37 | 249 38 | 185 39 | 329 40 | 306 41 | 197 42 | 119 43 | 239 44 | 24 45 | 54 46 | 233 47 | 15 48 | 116 49 | 12 50 | 55 51 | 128 52 | 307 53 | 252 54 | 20 55 | 28 56 | 122 57 | 184 58 | 303 59 | 215 60 | 240 61 | 305 62 | 325 63 | 321 64 | 140 65 | 295 66 | 225 67 | 172 68 | 97 69 | 33 70 | 271 71 | 142 72 | 90 73 | 124 74 | 278 75 | 36 76 | 96 77 | 154 78 | 199 79 | 39 80 | 79 81 | 126 82 | 0 83 | 214 84 | 320 85 | 81 86 | 310 87 | 92 88 | 37 89 | 6 90 | 53 91 | 160 92 | 245 93 | 65 94 | 112 95 | 228 96 | 212 97 | 120 98 | 43 99 | 100 100 | 196 101 | 149 102 | 205 103 | 300 104 | 178 105 | 21 106 | 27 107 | 224 108 | 34 109 | 105 110 | 219 111 | 192 112 | 207 113 | 221 114 | 176 115 | 241 116 | 68 117 | 151 118 | 324 119 | 4 120 | 1 121 | 77 122 | 213 123 | 109 124 | 134 125 | 29 126 | 217 127 | 230 128 | 82 129 | 210 130 | 203 131 | 315 132 | 177 133 | 145 134 | 84 135 | 146 136 | 22 137 | 110 138 | 59 139 | 114 140 | 118 141 | 164 142 | 269 143 | 293 144 | 191 145 | 302 146 | 317 147 | 253 148 | 251 149 | 272 150 | 313 151 | 343 152 | 236 153 | 86 154 | 195 155 | 170 156 | 188 157 | 83 158 | 268 159 | 189 160 | 66 161 | 72 162 | 314 163 | 311 164 | 9 165 | 168 166 | 166 167 | 133 168 | 2 169 | 296 170 | 257 171 | 17 172 | 322 173 | 332 174 | 274 175 | 131 176 | 289 177 | 287 178 | 156 179 | 260 180 | 35 181 | 44 182 | 277 183 | 198 184 | 238 185 | 32 186 | 50 187 | 58 188 | 93 189 | 102 190 | 91 191 | 250 192 | 137 193 | 132 194 | 208 195 | 204 196 | 94 197 | 312 198 | 60 199 | 186 200 | 10 201 | 61 202 | 209 203 | 141 204 | 70 205 | 169 206 | 117 207 | 283 208 | 42 209 | 206 210 | 336 211 | 123 212 | 276 213 | 194 214 | 242 215 | 201 216 | 223 217 | 127 218 | 232 219 | 220 220 | 111 221 | 148 222 | 76 223 | 101 224 | 113 225 | 342 226 | 244 227 | 226 228 | 222 229 | 261 230 | 48 231 | 69 232 | 216 233 | 40 234 | 153 235 | 231 236 | 152 237 | 294 238 | 275 239 | 256 240 | 318 241 | 341 242 | 338 243 | 234 244 | 292 245 | 265 246 | 158 247 | 319 248 | 85 249 | 262 250 | 47 251 | 18 252 | 237 253 | 218 254 | 284 255 | 273 256 | 46 257 | 106 258 | 125 259 | 288 260 | 258 261 | 334 262 | 182 263 | 339 264 | 162 265 | 3 266 | 139 267 | 326 268 | 227 269 | 71 270 | 183 271 | 23 272 | 285 273 | 41 274 | 5 275 | 263 276 | 235 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/PTC/inner_folds/train_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 264 2 | 107 3 | 103 4 | 290 5 | 211 6 | 51 7 | 298 8 | 16 9 | 63 10 | 115 11 | 200 12 | 301 13 | 333 14 | 255 15 | 337 16 | 175 17 | 95 18 | 64 19 | 327 20 | 280 21 | 247 22 | 78 23 | 130 24 | 187 25 | 74 26 | 328 27 | 173 28 | 45 29 | 174 30 | 248 31 | 161 32 | 143 33 | 31 34 | 291 35 | 316 36 | 249 37 | 329 38 | 306 39 | 254 40 | 197 41 | 119 42 | 80 43 | 239 44 | 24 45 | 54 46 | 330 47 | 233 48 | 15 49 | 116 50 | 12 51 | 55 52 | 128 53 | 307 54 | 252 55 | 20 56 | 28 57 | 122 58 | 184 59 | 303 60 | 215 61 | 240 62 | 305 63 | 325 64 | 321 65 | 140 66 | 295 67 | 225 68 | 97 69 | 33 70 | 271 71 | 142 72 | 90 73 | 202 74 | 278 75 | 36 76 | 96 77 | 154 78 | 49 79 | 199 80 | 159 81 | 39 82 | 79 83 | 126 84 | 0 85 | 320 86 | 81 87 | 310 88 | 129 89 | 92 90 | 37 91 | 53 92 | 160 93 | 245 94 | 65 95 | 112 96 | 73 97 | 228 98 | 212 99 | 120 100 | 43 101 | 100 102 | 196 103 | 149 104 | 205 105 | 300 106 | 178 107 | 21 108 | 27 109 | 224 110 | 34 111 | 105 112 | 192 113 | 221 114 | 176 115 | 68 116 | 151 117 | 324 118 | 56 119 | 52 120 | 134 121 | 29 122 | 217 123 | 230 124 | 82 125 | 210 126 | 203 127 | 315 128 | 177 129 | 145 130 | 84 131 | 146 132 | 22 133 | 110 134 | 108 135 | 114 136 | 118 137 | 164 138 | 269 139 | 30 140 | 293 141 | 191 142 | 302 143 | 317 144 | 253 145 | 251 146 | 272 147 | 313 148 | 343 149 | 86 150 | 195 151 | 188 152 | 83 153 | 268 154 | 189 155 | 66 156 | 72 157 | 246 158 | 314 159 | 311 160 | 9 161 | 157 162 | 166 163 | 133 164 | 2 165 | 296 166 | 257 167 | 17 168 | 322 169 | 332 170 | 274 171 | 131 172 | 289 173 | 287 174 | 156 175 | 35 176 | 44 177 | 277 178 | 198 179 | 238 180 | 32 181 | 50 182 | 58 183 | 104 184 | 144 185 | 121 186 | 266 187 | 155 188 | 299 189 | 38 190 | 331 191 | 180 192 | 297 193 | 309 194 | 138 195 | 88 196 | 62 197 | 165 198 | 323 199 | 135 200 | 26 201 | 163 202 | 167 203 | 136 204 | 67 205 | 282 206 | 147 207 | 150 208 | 8 209 | 279 210 | 11 211 | 98 212 | 229 213 | 193 214 | 93 215 | 102 216 | 91 217 | 250 218 | 137 219 | 132 220 | 208 221 | 204 222 | 94 223 | 312 224 | 60 225 | 186 226 | 259 227 | 10 228 | 61 229 | 7 230 | 209 231 | 141 232 | 70 233 | 169 234 | 335 235 | 283 236 | 42 237 | 206 238 | 336 239 | 123 240 | 276 241 | 194 242 | 201 243 | 223 244 | 127 245 | 232 246 | 220 247 | 111 248 | 181 249 | 76 250 | 101 251 | 113 252 | 342 253 | 244 254 | 226 255 | 270 256 | 222 257 | 261 258 | 48 259 | 69 260 | 216 261 | 40 262 | 243 263 | 153 264 | 231 265 | 152 266 | 99 267 | 294 268 | 275 269 | 256 270 | 318 271 | 341 272 | 338 273 | 190 274 | 234 275 | 292 276 | 267 277 | 171 278 | 14 279 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-1-1.txt: -------------------------------------------------------------------------------- 1 | 3753 2 | 1344 3 | 110 4 | 3277 5 | 3809 6 | 3365 7 | 983 8 | 4081 9 | 386 10 | 3428 11 | 3674 12 | 1269 13 | 1924 14 | 11 15 | 2587 16 | 3990 17 | 935 18 | 3447 19 | 2844 20 | 1523 21 | 3928 22 | 2310 23 | 1139 24 | 3335 25 | 3129 26 | 2739 27 | 315 28 | 70 29 | 3104 30 | 1740 31 | 1340 32 | 1669 33 | 3164 34 | 2709 35 | 2089 36 | 2515 37 | 1699 38 | 351 39 | 415 40 | 1512 41 | 1868 42 | 1558 43 | 2508 44 | 3249 45 | 2852 46 | 3267 47 | 2570 48 | 908 49 | 3672 50 | 3101 51 | 1777 52 | 686 53 | 2513 54 | 3056 55 | 963 56 | 2043 57 | 3601 58 | 253 59 | 304 60 | 127 61 | 496 62 | 2594 63 | 797 64 | 41 65 | 1069 66 | 3153 67 | 3450 68 | 372 69 | 926 70 | 416 71 | 3980 72 | 2678 73 | 4021 74 | 969 75 | 2551 76 | 2454 77 | 1621 78 | 3229 79 | 205 80 | 1088 81 | 774 82 | 4088 83 | 2421 84 | 958 85 | 2732 86 | 646 87 | 1378 88 | 3930 89 | 35 90 | 2645 91 | 573 92 | 107 93 | 2049 94 | 3503 95 | 2924 96 | 3258 97 | 3495 98 | 3824 99 | 322 100 | 3320 101 | 527 102 | 441 103 | 1474 104 | 743 105 | 3942 106 | 2009 107 | 2850 108 | 3865 109 | 228 110 | 1293 111 | 305 112 | 3185 113 | 3246 114 | 2787 115 | 1189 116 | 1149 117 | 1156 118 | 3583 119 | 548 120 | 3763 121 | 3715 122 | 406 123 | 2964 124 | 1645 125 | 3276 126 | 2842 127 | 2495 128 | 913 129 | 1703 130 | 2378 131 | 3349 132 | 2014 133 | 1526 134 | 2005 135 | 3002 136 | 2498 137 | 2882 138 | 3198 139 | 1835 140 | 3970 141 | 139 142 | 2937 143 | 4027 144 | 1798 145 | 1450 146 | 2078 147 | 1842 148 | 1660 149 | 2079 150 | 3341 151 | 388 152 | 1080 153 | 3857 154 | 3360 155 | 3796 156 | 1531 157 | 1594 158 | 68 159 | 2540 160 | 177 161 | 2670 162 | 1778 163 | 2671 164 | 1460 165 | 2065 166 | 3149 167 | 3560 168 | 2802 169 | 3993 170 | 2726 171 | 2145 172 | 1026 173 | 866 174 | 213 175 | 15 176 | 3590 177 | 2393 178 | 282 179 | 3654 180 | 3644 181 | 2857 182 | 1748 183 | 808 184 | 1828 185 | 2228 186 | 2038 187 | 1898 188 | 3516 189 | 3173 190 | 3168 191 | 3481 192 | 1437 193 | 1367 194 | 1021 195 | 1481 196 | 3684 197 | 55 198 | 1911 199 | 2965 200 | 3767 201 | 785 202 | 1477 203 | 4093 204 | 3211 205 | 662 206 | 1244 207 | 3580 208 | 223 209 | 394 210 | 1420 211 | 1747 212 | 936 213 | 242 214 | 1140 215 | 1525 216 | 285 217 | 3053 218 | 342 219 | 3200 220 | 317 221 | 182 222 | 3251 223 | 546 224 | 341 225 | 3675 226 | 381 227 | 3618 228 | 997 229 | 2139 230 | 389 231 | 2464 232 | 502 233 | 9 234 | 2242 235 | 3112 236 | 2359 237 | 3561 238 | 2757 239 | 2714 240 | 713 241 | 2356 242 | 1128 243 | 2938 244 | 722 245 | 2293 246 | 2204 247 | 3255 248 | 3102 249 | 1587 250 | 3572 251 | 1615 252 | 1468 253 | 951 254 | 3936 255 | 3700 256 | 2530 257 | 1565 258 | 3330 259 | 2219 260 | 2527 261 | 3699 262 | 1015 263 | 2916 264 | 71 265 | 1194 266 | 1938 267 | 1323 268 | 3159 269 | 2750 270 | 2629 271 | 467 272 | 1561 273 | 761 274 | 3751 275 | 3604 276 | 2657 277 | 2976 278 | 1568 279 | 2253 280 | 3995 281 | 1908 282 | 2751 283 | 1987 284 | 2320 285 | 3969 286 | 128 287 | 985 288 | 975 289 | 4048 290 | 2084 291 | 220 292 | 770 293 | 3243 294 | 876 295 | 2923 296 | 3867 297 | 3835 298 | 3398 299 | 2588 300 | 907 301 | 38 302 | 2482 303 | 854 304 | 2447 305 | 248 306 | 393 307 | 605 308 | 562 309 | 361 310 | 2286 311 | 1167 312 | 1063 313 | 3072 314 | 27 315 | 776 316 | 3816 317 | 3236 318 | 1811 319 | 2087 320 | 2817 321 | 2658 322 | 125 323 | 674 324 | 2933 325 | 1257 326 | 1225 327 | 3022 328 | 1766 329 | 2375 330 | 3110 331 | 1190 332 | 3263 333 | 2350 334 | 113 335 | 870 336 | 2946 337 | 3783 338 | 1616 339 | 1654 340 | 75 341 | 1091 342 | 1163 343 | 3054 344 | 613 345 | 3011 346 | 1768 347 | 2763 348 | 3592 349 | 4103 350 | 2108 351 | 1401 352 | 118 353 | 828 354 | 1283 355 | 3556 356 | 397 357 | 4069 358 | 1144 359 | 3895 360 | 1946 361 | 3568 362 | 2013 363 | 916 364 | 1055 365 | 3562 366 | 2485 367 | 1812 368 | 2394 369 | 3287 370 | 30 371 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-5-1.txt: -------------------------------------------------------------------------------- 1 | 3770 2 | 607 3 | 1051 4 | 3839 5 | 2489 6 | 4087 7 | 622 8 | 1972 9 | 4042 10 | 950 11 | 2593 12 | 2090 13 | 135 14 | 1694 15 | 1936 16 | 4106 17 | 2112 18 | 3477 19 | 2257 20 | 3831 21 | 2826 22 | 3393 23 | 3926 24 | 1424 25 | 298 26 | 2615 27 | 3076 28 | 2819 29 | 1320 30 | 2829 31 | 359 32 | 526 33 | 4015 34 | 3959 35 | 3846 36 | 1008 37 | 1382 38 | 3802 39 | 2637 40 | 2895 41 | 978 42 | 564 43 | 2003 44 | 2099 45 | 1422 46 | 3753 47 | 427 48 | 3188 49 | 3954 50 | 845 51 | 3888 52 | 3676 53 | 3365 54 | 3090 55 | 301 56 | 551 57 | 1989 58 | 1724 59 | 386 60 | 914 61 | 2408 62 | 552 63 | 537 64 | 1127 65 | 3233 66 | 54 67 | 44 68 | 861 69 | 23 70 | 92 71 | 2497 72 | 2563 73 | 2531 74 | 599 75 | 2032 76 | 485 77 | 1426 78 | 3197 79 | 2877 80 | 1830 81 | 1955 82 | 3456 83 | 3916 84 | 1280 85 | 3885 86 | 70 87 | 3606 88 | 1688 89 | 2422 90 | 3180 91 | 823 92 | 1590 93 | 2210 94 | 409 95 | 1402 96 | 3946 97 | 2891 98 | 518 99 | 1291 100 | 2522 101 | 1868 102 | 3045 103 | 2331 104 | 1341 105 | 1913 106 | 3672 107 | 2624 108 | 2513 109 | 85 110 | 270 111 | 855 112 | 3126 113 | 194 114 | 3301 115 | 1170 116 | 2232 117 | 2101 118 | 664 119 | 3212 120 | 2674 121 | 1215 122 | 2022 123 | 3370 124 | 969 125 | 905 126 | 2892 127 | 2738 128 | 2206 129 | 2113 130 | 2419 131 | 1037 132 | 3724 133 | 3206 134 | 151 135 | 682 136 | 3334 137 | 3784 138 | 3730 139 | 1098 140 | 4047 141 | 459 142 | 1663 143 | 2850 144 | 2577 145 | 2072 146 | 657 147 | 2685 148 | 947 149 | 149 150 | 3508 151 | 3185 152 | 81 153 | 3667 154 | 171 155 | 998 156 | 3120 157 | 2958 158 | 2815 159 | 3475 160 | 1207 161 | 1714 162 | 2586 163 | 1875 164 | 3132 165 | 437 166 | 1594 167 | 3611 168 | 68 169 | 3900 170 | 2306 171 | 2634 172 | 2050 173 | 1776 174 | 3789 175 | 99 176 | 3347 177 | 3431 178 | 1026 179 | 3890 180 | 3446 181 | 3870 182 | 3654 183 | 1162 184 | 1375 185 | 1241 186 | 3612 187 | 2476 188 | 2794 189 | 3216 190 | 3584 191 | 2496 192 | 259 193 | 1016 194 | 1911 195 | 320 196 | 3688 197 | 1191 198 | 2270 199 | 892 200 | 3901 201 | 1397 202 | 2426 203 | 3636 204 | 442 205 | 1244 206 | 3580 207 | 3210 208 | 4049 209 | 3807 210 | 272 211 | 4046 212 | 1140 213 | 2554 214 | 3512 215 | 2366 216 | 1168 217 | 2711 218 | 3070 219 | 2786 220 | 119 221 | 3251 222 | 2107 223 | 1589 224 | 3968 225 | 2430 226 | 4094 227 | 932 228 | 1204 229 | 2120 230 | 10 231 | 59 232 | 1818 233 | 1988 234 | 3996 235 | 572 236 | 2580 237 | 2328 238 | 2992 239 | 2279 240 | 1208 241 | 2938 242 | 2293 243 | 3542 244 | 273 245 | 2719 246 | 872 247 | 3392 248 | 1423 249 | 1895 250 | 3402 251 | 4012 252 | 1034 253 | 973 254 | 109 255 | 2961 256 | 1538 257 | 3626 258 | 509 259 | 2335 260 | 3827 261 | 332 262 | 492 263 | 1015 264 | 2398 265 | 4105 266 | 3486 267 | 649 268 | 2395 269 | 1133 270 | 1938 271 | 2453 272 | 1404 273 | 2203 274 | 3914 275 | 1675 276 | 3383 277 | 2061 278 | 2006 279 | 1054 280 | 1082 281 | 1455 282 | 3786 283 | 2565 284 | 3384 285 | 1032 286 | 2781 287 | 578 288 | 2920 289 | 1987 290 | 530 291 | 759 292 | 3649 293 | 598 294 | 1491 295 | 4104 296 | 3221 297 | 3873 298 | 2993 299 | 3781 300 | 38 301 | 2105 302 | 393 303 | 1943 304 | 3451 305 | 3838 306 | 246 307 | 1308 308 | 3289 309 | 3661 310 | 1063 311 | 3925 312 | 1119 313 | 3055 314 | 131 315 | 674 316 | 2912 317 | 2622 318 | 2644 319 | 2012 320 | 2196 321 | 1499 322 | 1281 323 | 3022 324 | 65 325 | 3999 326 | 26 327 | 532 328 | 870 329 | 89 330 | 2848 331 | 2906 332 | 331 333 | 455 334 | 1715 335 | 981 336 | 3524 337 | 204 338 | 1846 339 | 778 340 | 2876 341 | 706 342 | 1317 343 | 1419 344 | 1421 345 | 3083 346 | 141 347 | 2763 348 | 1035 349 | 2175 350 | 2880 351 | 2457 352 | 2798 353 | 3670 354 | 446 355 | 1946 356 | 3600 357 | 3328 358 | 283 359 | 3707 360 | 2013 361 | 1198 362 | 3026 363 | 1634 364 | 2718 365 | 214 366 | 3455 367 | 2315 368 | 1593 369 | 8 370 | 3800 371 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-6-1.txt: -------------------------------------------------------------------------------- 1 | 3774 2 | 1930 3 | 1058 4 | 3747 5 | 4084 6 | 3953 7 | 2593 8 | 637 9 | 576 10 | 2090 11 | 3701 12 | 1757 13 | 2010 14 | 3415 15 | 2257 16 | 2883 17 | 3831 18 | 1400 19 | 208 20 | 2583 21 | 1292 22 | 3215 23 | 3702 24 | 2690 25 | 1797 26 | 3666 27 | 3470 28 | 1862 29 | 4017 30 | 3959 31 | 382 32 | 2479 33 | 287 34 | 899 35 | 1458 36 | 2448 37 | 2661 38 | 1482 39 | 1102 40 | 1336 41 | 2405 42 | 1763 43 | 179 44 | 2152 45 | 1687 46 | 692 47 | 1391 48 | 3809 49 | 1900 50 | 3888 51 | 1410 52 | 1928 53 | 1019 54 | 1994 55 | 3806 56 | 6 57 | 2818 58 | 1607 59 | 1752 60 | 1252 61 | 2960 62 | 3593 63 | 3059 64 | 24 65 | 1600 66 | 4013 67 | 555 68 | 1924 69 | 3357 70 | 338 71 | 2450 72 | 2811 73 | 744 74 | 4099 75 | 851 76 | 2859 77 | 2995 78 | 2529 79 | 2660 80 | 1963 81 | 2617 82 | 3222 83 | 1515 84 | 4097 85 | 850 86 | 1414 87 | 315 88 | 2494 89 | 3167 90 | 3164 91 | 501 92 | 1522 93 | 652 94 | 518 95 | 1291 96 | 1664 97 | 2522 98 | 2337 99 | 3788 100 | 2559 101 | 209 102 | 290 103 | 1940 104 | 3311 105 | 1221 106 | 699 107 | 1078 108 | 3647 109 | 183 110 | 817 111 | 2737 112 | 3071 113 | 3301 114 | 1214 115 | 362 116 | 313 117 | 91 118 | 3975 119 | 2318 120 | 3904 121 | 3714 122 | 1791 123 | 3342 124 | 3035 125 | 2542 126 | 1624 127 | 3373 128 | 1306 129 | 1980 130 | 2784 131 | 212 132 | 969 133 | 905 134 | 584 135 | 2595 136 | 1239 137 | 1729 138 | 205 139 | 499 140 | 3972 141 | 3231 142 | 2732 143 | 3994 144 | 3963 145 | 3235 146 | 2248 147 | 3500 148 | 497 149 | 2222 150 | 444 151 | 829 152 | 1262 153 | 58 154 | 281 155 | 1153 156 | 3191 157 | 2156 158 | 2705 159 | 2553 160 | 4047 161 | 400 162 | 3433 163 | 7 164 | 2972 165 | 721 166 | 1690 167 | 2567 168 | 1885 169 | 1483 170 | 947 171 | 939 172 | 3508 173 | 3859 174 | 1149 175 | 1237 176 | 312 177 | 1156 178 | 3120 179 | 2966 180 | 3947 181 | 2137 182 | 3712 183 | 4077 184 | 3541 185 | 2094 186 | 684 187 | 3349 188 | 1706 189 | 1130 190 | 3242 191 | 702 192 | 2498 193 | 240 194 | 2882 195 | 2773 196 | 2126 197 | 262 198 | 3671 199 | 2057 200 | 2155 201 | 2839 202 | 3573 203 | 1678 204 | 4025 205 | 1662 206 | 147 207 | 1644 208 | 2971 209 | 1655 210 | 1161 211 | 1620 212 | 3378 213 | 648 214 | 1945 215 | 3574 216 | 3028 217 | 2269 218 | 2008 219 | 2163 220 | 231 221 | 45 222 | 1374 223 | 809 224 | 1140 225 | 1525 226 | 1357 227 | 2766 228 | 3305 229 | 410 230 | 1599 231 | 1275 232 | 342 233 | 1761 234 | 452 235 | 3023 236 | 2879 237 | 2384 238 | 641 239 | 1677 240 | 3127 241 | 846 242 | 4 243 | 1973 244 | 1141 245 | 2275 246 | 1691 247 | 1859 248 | 932 249 | 1988 250 | 1478 251 | 343 252 | 2580 253 | 2356 254 | 966 255 | 1029 256 | 4096 257 | 1652 258 | 3961 259 | 2722 260 | 1503 261 | 571 262 | 3757 263 | 1356 264 | 3552 265 | 3883 266 | 344 267 | 2095 268 | 1953 269 | 3171 270 | 3176 271 | 332 272 | 719 273 | 1858 274 | 454 275 | 590 276 | 57 277 | 51 278 | 1395 279 | 53 280 | 3272 281 | 3413 282 | 1390 283 | 2462 284 | 145 285 | 938 286 | 2461 287 | 2471 288 | 3146 289 | 3317 290 | 3383 291 | 4031 292 | 1333 293 | 634 294 | 2006 295 | 767 296 | 2253 297 | 2445 298 | 1896 299 | 3103 300 | 3384 301 | 1032 302 | 2781 303 | 42 304 | 2751 305 | 1177 306 | 2486 307 | 2401 308 | 1583 309 | 1371 310 | 3039 311 | 1188 312 | 3761 313 | 900 314 | 976 315 | 3867 316 | 3648 317 | 3150 318 | 2105 319 | 211 320 | 2562 321 | 683 322 | 837 323 | 2286 324 | 3107 325 | 1063 326 | 803 327 | 3072 328 | 3816 329 | 1321 330 | 1811 331 | 3887 332 | 3727 333 | 3371 334 | 2164 335 | 3058 336 | 674 337 | 1595 338 | 2196 339 | 2633 340 | 3297 341 | 1315 342 | 2511 343 | 1379 344 | 3093 345 | 3331 346 | 3863 347 | 2560 348 | 407 349 | 4060 350 | 940 351 | 3538 352 | 3134 353 | 4022 354 | 1057 355 | 1419 356 | 1192 357 | 3448 358 | 2332 359 | 3423 360 | 716 361 | 446 362 | 1856 363 | 701 364 | 730 365 | 928 366 | 977 367 | 2339 368 | 1910 369 | 1617 370 | 522 371 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-4-1.txt: -------------------------------------------------------------------------------- 1 | 63 2 | 247 3 | 1970 4 | 453 5 | 3774 6 | 1930 7 | 1596 8 | 772 9 | 3777 10 | 1497 11 | 1995 12 | 3967 13 | 737 14 | 4087 15 | 622 16 | 4002 17 | 822 18 | 950 19 | 1727 20 | 3239 21 | 1358 22 | 4074 23 | 2410 24 | 2076 25 | 1164 26 | 856 27 | 4008 28 | 3785 29 | 505 30 | 3918 31 | 1053 32 | 3926 33 | 1833 34 | 601 35 | 2843 36 | 1028 37 | 996 38 | 676 39 | 2459 40 | 906 41 | 466 42 | 2895 43 | 978 44 | 899 45 | 2663 46 | 2376 47 | 353 48 | 647 49 | 1036 50 | 970 51 | 427 52 | 3523 53 | 1832 54 | 4076 55 | 3188 56 | 1495 57 | 3806 58 | 3934 59 | 3744 60 | 3381 61 | 1607 62 | 3558 63 | 4010 64 | 301 65 | 1989 66 | 3428 67 | 552 68 | 1600 69 | 555 70 | 306 71 | 2641 72 | 3019 73 | 2985 74 | 3990 75 | 935 76 | 3447 77 | 92 78 | 161 79 | 308 80 | 2995 81 | 3978 82 | 2048 83 | 108 84 | 1211 85 | 1012 86 | 70 87 | 2422 88 | 610 89 | 1065 90 | 3494 91 | 1709 92 | 2442 93 | 2215 94 | 1254 95 | 472 96 | 987 97 | 2470 98 | 2769 99 | 614 100 | 3267 101 | 2935 102 | 1940 103 | 686 104 | 2624 105 | 1877 106 | 1222 107 | 2484 108 | 85 109 | 699 110 | 2727 111 | 3308 112 | 3719 113 | 3021 114 | 749 115 | 3247 116 | 3609 117 | 882 118 | 782 119 | 1214 120 | 46 121 | 3125 122 | 265 123 | 1170 124 | 1575 125 | 2908 126 | 417 127 | 3919 128 | 2674 129 | 2639 130 | 3370 131 | 2551 132 | 94 133 | 3971 134 | 3844 135 | 3276 136 | 3144 137 | 3033 138 | 2094 139 | 375 140 | 486 141 | 3001 142 | 804 143 | 258 144 | 1880 145 | 2514 146 | 702 147 | 2498 148 | 715 149 | 2276 150 | 1835 151 | 3300 152 | 3194 153 | 262 154 | 3062 155 | 2057 156 | 1798 157 | 1605 158 | 3879 159 | 1678 160 | 1863 161 | 1842 162 | 4091 163 | 224 164 | 147 165 | 2468 166 | 2968 167 | 3439 168 | 943 169 | 2182 170 | 2822 171 | 388 172 | 3782 173 | 2638 174 | 1298 175 | 3360 176 | 3796 177 | 1603 178 | 3900 179 | 136 180 | 1334 181 | 3142 182 | 2306 183 | 911 184 | 1415 185 | 1460 186 | 1260 187 | 2053 188 | 1702 189 | 3616 190 | 3431 191 | 2502 192 | 852 193 | 591 194 | 3318 195 | 2608 196 | 1608 197 | 542 198 | 3429 199 | 3530 200 | 1898 201 | 2166 202 | 207 203 | 1101 204 | 3228 205 | 2868 206 | 3842 207 | 3420 208 | 4102 209 | 2147 210 | 55 211 | 2934 212 | 1628 213 | 320 214 | 69 215 | 2827 216 | 662 217 | 1212 218 | 363 219 | 2643 220 | 1357 221 | 1033 222 | 3732 223 | 1275 224 | 1684 225 | 2404 226 | 1507 227 | 3070 228 | 1500 229 | 769 230 | 883 231 | 4007 232 | 718 233 | 3675 234 | 3640 235 | 1887 236 | 2932 237 | 3122 238 | 2139 239 | 2114 240 | 2275 241 | 1700 242 | 2120 243 | 2359 244 | 1769 245 | 1478 246 | 3252 247 | 3179 248 | 2992 249 | 2321 250 | 713 251 | 589 252 | 390 253 | 2204 254 | 2159 255 | 3669 256 | 2922 257 | 201 258 | 2308 259 | 1356 260 | 3987 261 | 2200 262 | 2961 263 | 225 264 | 1790 265 | 344 266 | 3936 267 | 2701 268 | 2618 269 | 1824 270 | 3860 271 | 1659 272 | 2168 273 | 1673 274 | 1194 275 | 1731 276 | 2952 277 | 2575 278 | 1084 279 | 1323 280 | 3079 281 | 2453 282 | 3914 283 | 2006 284 | 3604 285 | 2976 286 | 2957 287 | 724 288 | 1459 289 | 144 290 | 1689 291 | 4048 292 | 3761 293 | 2923 294 | 2154 295 | 324 296 | 449 297 | 3398 298 | 1174 299 | 2121 300 | 1640 301 | 3186 302 | 3493 303 | 907 304 | 3726 305 | 38 306 | 327 307 | 2447 308 | 2507 309 | 2928 310 | 376 311 | 2124 312 | 2030 313 | 1368 314 | 3289 315 | 1751 316 | 1074 317 | 3371 318 | 1296 319 | 1417 320 | 3388 321 | 2549 322 | 3820 323 | 1993 324 | 886 325 | 3713 326 | 1781 327 | 95 328 | 1555 329 | 2375 330 | 2350 331 | 113 332 | 1238 333 | 2560 334 | 2011 335 | 1854 336 | 3551 337 | 979 338 | 521 339 | 3465 340 | 651 341 | 507 342 | 418 343 | 1163 344 | 2561 345 | 3092 346 | 663 347 | 1124 348 | 1352 349 | 426 350 | 2743 351 | 2418 352 | 2869 353 | 159 354 | 2311 355 | 3658 356 | 1401 357 | 118 358 | 412 359 | 2986 360 | 3376 361 | 1285 362 | 3670 363 | 1946 364 | 3568 365 | 672 366 | 180 367 | 2488 368 | 2240 369 | 4067 370 | 3368 371 | 635 372 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-8-1.txt: -------------------------------------------------------------------------------- 1 | 3716 2 | 2246 3 | 3774 4 | 4043 5 | 3141 6 | 1284 7 | 737 8 | 4087 9 | 2593 10 | 3436 11 | 3489 12 | 264 13 | 3477 14 | 3415 15 | 2528 16 | 3918 17 | 4011 18 | 2294 19 | 3322 20 | 3657 21 | 3854 22 | 626 23 | 2837 24 | 3076 25 | 245 26 | 1774 27 | 3323 28 | 1028 29 | 697 30 | 174 31 | 2343 32 | 990 33 | 2679 34 | 3187 35 | 1412 36 | 4034 37 | 2943 38 | 427 39 | 1832 40 | 1950 41 | 692 42 | 48 43 | 1302 44 | 1148 45 | 2463 46 | 1224 47 | 1656 48 | 3558 49 | 4010 50 | 3386 51 | 1708 52 | 243 53 | 191 54 | 1647 55 | 306 56 | 4040 57 | 3903 58 | 3274 59 | 890 60 | 54 61 | 1072 62 | 1473 63 | 3646 64 | 23 65 | 2969 66 | 599 67 | 1196 68 | 3201 69 | 2433 70 | 2271 71 | 3335 72 | 2142 73 | 329 74 | 4035 75 | 3933 76 | 315 77 | 543 78 | 1586 79 | 3164 80 | 2709 81 | 409 82 | 1402 83 | 2515 84 | 1048 85 | 652 86 | 3494 87 | 2117 88 | 1512 89 | 472 90 | 3087 91 | 209 92 | 2852 93 | 614 94 | 385 95 | 1093 96 | 3672 97 | 1388 98 | 1221 99 | 3862 100 | 2727 101 | 3165 102 | 3491 103 | 596 104 | 3719 105 | 1578 106 | 2749 107 | 443 108 | 2601 109 | 3350 110 | 2280 111 | 1122 112 | 3459 113 | 704 114 | 2259 115 | 2067 116 | 260 117 | 3324 118 | 72 119 | 3184 120 | 603 121 | 3018 122 | 1621 123 | 3113 124 | 205 125 | 1472 126 | 3338 127 | 1720 128 | 3231 129 | 4088 130 | 370 131 | 3821 132 | 2248 133 | 3068 134 | 796 135 | 691 136 | 573 137 | 2183 138 | 3334 139 | 2004 140 | 511 141 | 3123 142 | 757 143 | 3191 144 | 4047 145 | 2509 146 | 2184 147 | 3213 148 | 1052 149 | 76 150 | 4039 151 | 305 152 | 3517 153 | 1189 154 | 2809 155 | 3346 156 | 3834 157 | 739 158 | 1383 159 | 3886 160 | 1399 161 | 2202 162 | 2297 163 | 2681 164 | 3492 165 | 1786 166 | 771 167 | 1880 168 | 1195 169 | 1706 170 | 3130 171 | 2498 172 | 3194 173 | 3062 174 | 2238 175 | 3291 176 | 2057 177 | 4071 178 | 2192 179 | 1755 180 | 788 181 | 1450 182 | 1370 183 | 689 184 | 147 185 | 3533 186 | 3985 187 | 2981 188 | 3476 189 | 2800 190 | 2189 191 | 2971 192 | 1848 193 | 1620 194 | 2942 195 | 3282 196 | 4006 197 | 3043 198 | 1531 199 | 1594 200 | 2540 201 | 1546 202 | 2306 203 | 3192 204 | 1612 205 | 2050 206 | 1447 207 | 2065 208 | 1229 209 | 2290 210 | 1702 211 | 2169 212 | 3560 213 | 1092 214 | 3170 215 | 3890 216 | 2779 217 | 2672 218 | 2415 219 | 1674 220 | 282 221 | 162 222 | 930 223 | 591 224 | 3318 225 | 542 226 | 2144 227 | 2190 228 | 2746 229 | 2866 230 | 3168 231 | 3683 232 | 3584 233 | 4003 234 | 132 235 | 2292 236 | 1937 237 | 1883 238 | 1911 239 | 585 240 | 1628 241 | 3374 242 | 320 243 | 231 244 | 3576 245 | 242 246 | 750 247 | 1658 248 | 1979 249 | 2366 250 | 2610 251 | 1449 252 | 452 253 | 2404 254 | 169 255 | 1638 256 | 997 257 | 2547 258 | 4085 259 | 2764 260 | 1973 261 | 3066 262 | 1906 263 | 1109 264 | 1099 265 | 1020 266 | 3874 267 | 3992 268 | 2120 269 | 2605 270 | 217 271 | 3384 272 | 1442 273 | 2591 274 | 3174 275 | 569 276 | 1583 277 | 1371 278 | 847 279 | 985 280 | 4048 281 | 770 282 | 4104 283 | 976 284 | 377 285 | 3764 286 | 1154 287 | 1174 288 | 1668 289 | 3186 290 | 3726 291 | 3896 292 | 2105 293 | 2447 294 | 248 295 | 683 296 | 579 297 | 2887 298 | 3756 299 | 2795 300 | 1303 301 | 2124 302 | 2931 303 | 3462 304 | 1113 305 | 3661 306 | 588 307 | 2715 308 | 3816 309 | 1119 310 | 4064 311 | 261 312 | 3388 313 | 3162 314 | 1772 315 | 2012 316 | 2788 317 | 3478 318 | 65 319 | 962 320 | 781 321 | 688 322 | 2375 323 | 3263 324 | 1534 325 | 113 326 | 1746 327 | 624 328 | 3340 329 | 331 330 | 4037 331 | 3526 332 | 503 333 | 2499 334 | 419 335 | 3538 336 | 1351 337 | 2236 338 | 777 339 | 4022 340 | 3257 341 | 1421 342 | 1865 343 | 2856 344 | 3592 345 | 4103 346 | 129 347 | 3116 348 | 2492 349 | 2986 350 | 2457 351 | 3556 352 | 773 353 | 2249 354 | 3729 355 | 672 356 | 1856 357 | 3525 358 | 1433 359 | 1055 360 | 1179 361 | 2339 362 | 635 363 | 3455 364 | 2097 365 | 2315 366 | 858 367 | 2789 368 | 8 369 | 3937 370 | 2351 371 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-2-1.txt: -------------------------------------------------------------------------------- 1 | 3444 2 | 1247 3 | 1439 4 | 1970 5 | 1058 6 | 3839 7 | 1479 8 | 2081 9 | 3143 10 | 2870 11 | 1951 12 | 2776 13 | 3239 14 | 448 15 | 135 16 | 203 17 | 1716 18 | 3701 19 | 1757 20 | 1089 21 | 3265 22 | 3831 23 | 2058 24 | 3393 25 | 4011 26 | 2358 27 | 1695 28 | 1686 29 | 2439 30 | 33 31 | 2432 32 | 1774 33 | 2810 34 | 2109 35 | 676 36 | 2652 37 | 12 38 | 2368 39 | 3214 40 | 3180 41 | 3166 42 | 2515 43 | 1065 44 | 2131 45 | 1291 46 | 2434 47 | 2998 48 | 1254 49 | 196 50 | 2252 51 | 1231 52 | 1060 53 | 2312 54 | 3351 55 | 385 56 | 2400 57 | 2590 58 | 97 59 | 3653 60 | 2309 61 | 4083 62 | 765 63 | 352 64 | 31 65 | 1138 66 | 3904 67 | 3310 68 | 2687 69 | 1575 70 | 1297 71 | 2440 72 | 372 73 | 926 74 | 678 75 | 416 76 | 1215 77 | 3929 78 | 4021 79 | 969 80 | 2551 81 | 3018 82 | 812 83 | 3472 84 | 832 85 | 3248 86 | 2478 87 | 2543 88 | 2140 89 | 3619 90 | 1025 91 | 3595 92 | 3741 93 | 3232 94 | 2119 95 | 1873 96 | 757 97 | 2156 98 | 1725 99 | 2553 100 | 314 101 | 459 102 | 1476 103 | 3943 104 | 1672 105 | 2972 106 | 2572 107 | 3327 108 | 251 109 | 2685 110 | 2449 111 | 3140 112 | 3460 113 | 1428 114 | 2428 115 | 357 116 | 998 117 | 2707 118 | 2068 119 | 1126 120 | 3656 121 | 909 122 | 1965 123 | 565 124 | 3679 125 | 1399 126 | 2317 127 | 3094 128 | 1501 129 | 3698 130 | 3541 131 | 1085 132 | 1990 133 | 2650 134 | 197 135 | 3889 136 | 316 137 | 3226 138 | 2033 139 | 1836 140 | 2697 141 | 2514 142 | 3911 143 | 1046 144 | 3242 145 | 2046 146 | 104 147 | 3002 148 | 1047 149 | 1339 150 | 2498 151 | 1014 152 | 3571 153 | 2736 154 | 84 155 | 262 156 | 1653 157 | 2066 158 | 1529 159 | 1678 160 | 1863 161 | 1318 162 | 4091 163 | 224 164 | 3662 165 | 2468 166 | 2100 167 | 3533 168 | 3985 169 | 658 170 | 2800 171 | 3790 172 | 3857 173 | 1875 174 | 440 175 | 3796 176 | 593 177 | 1504 178 | 1546 179 | 869 180 | 1181 181 | 2065 182 | 2873 183 | 2403 184 | 3793 185 | 4108 186 | 1702 187 | 1114 188 | 3073 189 | 4004 190 | 2371 191 | 2415 192 | 3870 193 | 2481 194 | 1295 195 | 2857 196 | 3217 197 | 3091 198 | 1502 199 | 3787 200 | 3425 201 | 805 202 | 3354 203 | 659 204 | 234 205 | 1437 206 | 707 207 | 4003 208 | 1753 209 | 1021 210 | 1937 211 | 1481 212 | 1016 213 | 2768 214 | 320 215 | 4093 216 | 1775 217 | 3694 218 | 1331 219 | 1870 220 | 2163 221 | 539 222 | 231 223 | 3210 224 | 2720 225 | 936 226 | 64 227 | 363 228 | 3823 229 | 1357 230 | 1097 231 | 181 232 | 3520 233 | 3053 234 | 1275 235 | 2861 236 | 4007 237 | 1804 238 | 641 239 | 1589 240 | 1490 241 | 2932 242 | 1226 243 | 137 244 | 846 245 | 2951 246 | 2828 247 | 2114 248 | 1859 249 | 451 250 | 1519 251 | 1548 252 | 3717 253 | 1204 254 | 2698 255 | 2359 256 | 123 257 | 2757 258 | 1277 259 | 2714 260 | 86 261 | 713 262 | 966 263 | 1128 264 | 1208 265 | 1335 266 | 3080 267 | 1503 268 | 1353 269 | 1895 270 | 3757 271 | 2520 272 | 3883 273 | 951 274 | 1540 275 | 3176 276 | 3181 277 | 492 278 | 2219 279 | 487 280 | 941 281 | 3253 282 | 3910 283 | 2441 284 | 2168 285 | 404 286 | 1108 287 | 1959 288 | 1395 289 | 1133 290 | 53 291 | 4072 292 | 824 293 | 1765 294 | 3079 295 | 1404 296 | 1675 297 | 838 298 | 761 299 | 2000 300 | 3665 301 | 1648 302 | 2291 303 | 1847 304 | 1896 305 | 1908 306 | 3353 307 | 3507 308 | 578 309 | 2486 310 | 2526 311 | 759 312 | 598 313 | 4104 314 | 1609 315 | 2024 316 | 976 317 | 3835 318 | 843 319 | 3648 320 | 3781 321 | 2482 322 | 1135 323 | 683 324 | 3325 325 | 376 326 | 863 327 | 3107 328 | 1074 329 | 2872 330 | 3620 331 | 3065 332 | 1225 333 | 95 334 | 2633 335 | 929 336 | 2977 337 | 3022 338 | 2793 339 | 1309 340 | 3697 341 | 2174 342 | 991 343 | 3110 344 | 222 345 | 1884 346 | 967 347 | 3331 348 | 2848 349 | 1746 350 | 3766 351 | 1654 352 | 39 353 | 1107 354 | 2949 355 | 778 356 | 318 357 | 3134 358 | 567 359 | 1035 360 | 2332 361 | 3423 362 | 3556 363 | 701 364 | 1634 365 | 1676 366 | 2864 367 | 300 368 | 1617 369 | 2500 370 | 3937 371 | 1808 372 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-3-1.txt: -------------------------------------------------------------------------------- 1 | 1247 2 | 1582 3 | 1058 4 | 3839 5 | 2489 6 | 1243 7 | 737 8 | 1665 9 | 1972 10 | 4029 11 | 1951 12 | 602 13 | 1272 14 | 1694 15 | 3205 16 | 3399 17 | 1027 18 | 3477 19 | 3482 20 | 2883 21 | 1271 22 | 995 23 | 2753 24 | 2703 25 | 1201 26 | 3702 27 | 1227 28 | 1090 29 | 1361 30 | 1028 31 | 996 32 | 526 33 | 1862 34 | 874 35 | 2348 36 | 2637 37 | 2368 38 | 4023 39 | 353 40 | 358 41 | 1120 42 | 3861 43 | 1901 44 | 2138 45 | 1950 46 | 458 47 | 1817 48 | 490 49 | 1111 50 | 1495 51 | 3422 52 | 226 53 | 1752 54 | 1269 55 | 306 56 | 1287 57 | 3891 58 | 54 59 | 3218 60 | 2531 61 | 2032 62 | 734 63 | 3040 64 | 3201 65 | 3197 66 | 2142 67 | 833 68 | 540 69 | 656 70 | 3845 71 | 70 72 | 2525 73 | 1611 74 | 1606 75 | 3917 76 | 1636 77 | 832 78 | 2478 79 | 3234 80 | 1720 81 | 685 82 | 370 83 | 1025 84 | 742 85 | 3994 86 | 3930 87 | 35 88 | 328 89 | 691 90 | 3230 91 | 3741 92 | 592 93 | 3232 94 | 3964 95 | 1873 96 | 3495 97 | 3004 98 | 3824 99 | 661 100 | 1711 101 | 3449 102 | 2509 103 | 643 104 | 1672 105 | 787 106 | 721 107 | 1690 108 | 3363 109 | 3189 110 | 3865 111 | 3898 112 | 305 113 | 3517 114 | 2072 115 | 733 116 | 3752 117 | 3859 118 | 1237 119 | 739 120 | 2068 121 | 3763 122 | 1418 123 | 2964 124 | 2132 125 | 3706 126 | 1915 127 | 3577 128 | 2681 129 | 3554 130 | 486 131 | 1990 132 | 684 133 | 383 134 | 1918 135 | 1086 136 | 2136 137 | 2514 138 | 1432 139 | 240 140 | 3598 141 | 3543 142 | 154 143 | 2238 144 | 2057 145 | 2283 146 | 3894 147 | 1923 148 | 2340 149 | 1798 150 | 2078 151 | 2278 152 | 1318 153 | 1370 154 | 1878 155 | 3662 156 | 3673 157 | 1660 158 | 933 159 | 1218 160 | 364 161 | 3790 162 | 3341 163 | 3475 164 | 2638 165 | 2510 166 | 1312 167 | 2178 168 | 3098 169 | 2217 170 | 2172 171 | 593 172 | 252 173 | 1603 174 | 3025 175 | 2670 176 | 1373 177 | 2093 178 | 3877 179 | 2065 180 | 2345 181 | 670 182 | 4057 183 | 4108 184 | 2802 185 | 2726 186 | 1092 187 | 438 188 | 356 189 | 1879 190 | 4016 191 | 236 192 | 1651 193 | 162 194 | 56 195 | 808 196 | 2251 197 | 2228 198 | 1350 199 | 2472 200 | 399 201 | 805 202 | 2807 203 | 707 204 | 423 205 | 1332 206 | 3430 207 | 862 208 | 2397 209 | 2881 210 | 471 211 | 708 212 | 405 213 | 3147 214 | 223 215 | 1253 216 | 2941 217 | 2437 218 | 349 219 | 195 220 | 2554 221 | 3732 222 | 1449 223 | 3520 224 | 2353 225 | 650 226 | 1684 227 | 859 228 | 580 229 | 2179 230 | 2879 231 | 169 232 | 3640 233 | 2220 234 | 2932 235 | 1571 236 | 846 237 | 3275 238 | 3968 239 | 2139 240 | 2828 241 | 2114 242 | 1020 243 | 2754 244 | 1486 245 | 3605 246 | 2120 247 | 2073 248 | 10 249 | 2757 250 | 3458 251 | 3996 252 | 1128 253 | 2635 254 | 2938 255 | 4058 256 | 1480 257 | 3419 258 | 3102 259 | 4012 260 | 1701 261 | 3626 262 | 3464 263 | 2263 264 | 344 265 | 2530 266 | 3922 267 | 1602 268 | 288 269 | 649 270 | 1976 271 | 2673 272 | 1673 273 | 2223 274 | 2579 275 | 1390 276 | 1323 277 | 611 278 | 2221 279 | 2911 280 | 3914 281 | 3317 282 | 2686 283 | 1076 284 | 268 285 | 634 286 | 2061 287 | 896 288 | 1648 289 | 163 290 | 2253 291 | 2445 292 | 2241 293 | 1459 294 | 1032 295 | 578 296 | 2751 297 | 366 298 | 530 299 | 3728 300 | 1840 301 | 3867 302 | 1200 303 | 4051 304 | 907 305 | 3726 306 | 1112 307 | 2105 308 | 327 309 | 1290 310 | 1827 311 | 1509 312 | 2887 313 | 863 314 | 2341 315 | 2460 316 | 3107 317 | 3072 318 | 2700 319 | 1240 320 | 1811 321 | 131 322 | 200 323 | 3388 324 | 3820 325 | 1225 326 | 1666 327 | 3514 328 | 929 329 | 1738 330 | 3769 331 | 2848 332 | 1009 333 | 917 334 | 3340 335 | 3526 336 | 2561 337 | 1846 338 | 2281 339 | 2236 340 | 2518 341 | 706 342 | 663 343 | 3621 344 | 4022 345 | 810 346 | 1110 347 | 2063 348 | 1192 349 | 2418 350 | 2869 351 | 159 352 | 3658 353 | 4075 354 | 716 355 | 1802 356 | 3570 357 | 4024 358 | 1856 359 | 701 360 | 2491 361 | 1783 362 | 1433 363 | 4067 364 | 693 365 | 430 366 | 3368 367 | 152 368 | 2394 369 | 2205 370 | 3427 371 | 2789 372 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-7-1.txt: -------------------------------------------------------------------------------- 1 | 1247 2 | 1582 3 | 3682 4 | 2721 5 | 1665 6 | 1682 7 | 849 8 | 1727 9 | 2090 10 | 3084 11 | 135 12 | 3991 13 | 766 14 | 2417 15 | 1936 16 | 1716 17 | 3805 18 | 2883 19 | 3854 20 | 3298 21 | 3306 22 | 1907 23 | 2615 24 | 2843 25 | 2819 26 | 1774 27 | 1320 28 | 3666 29 | 990 30 | 2652 31 | 3799 32 | 466 33 | 1588 34 | 2020 35 | 3802 36 | 287 37 | 2944 38 | 1482 39 | 1234 40 | 1336 41 | 358 42 | 491 43 | 4009 44 | 2493 45 | 1070 46 | 3096 47 | 3771 48 | 3523 49 | 48 50 | 110 51 | 957 52 | 369 53 | 1914 54 | 3806 55 | 2589 56 | 725 57 | 4010 58 | 3203 59 | 791 60 | 1724 61 | 1158 62 | 3773 63 | 538 64 | 1384 65 | 11 66 | 4040 67 | 360 68 | 2450 69 | 3233 70 | 3990 71 | 1180 72 | 2811 73 | 2497 74 | 2531 75 | 1359 76 | 2271 77 | 654 78 | 2282 79 | 3104 80 | 1505 81 | 1669 82 | 3166 83 | 198 84 | 501 85 | 2089 86 | 652 87 | 2414 88 | 1484 89 | 2434 90 | 2998 91 | 2337 92 | 3114 93 | 2194 94 | 1341 95 | 3537 96 | 705 97 | 3296 98 | 1777 99 | 2484 100 | 1282 101 | 3165 102 | 855 103 | 817 104 | 2601 105 | 2043 106 | 3315 107 | 782 108 | 2216 109 | 1639 110 | 3319 111 | 3382 112 | 2835 113 | 2651 114 | 3450 115 | 2232 116 | 3822 117 | 3154 118 | 401 119 | 1354 120 | 1545 121 | 2674 122 | 3270 123 | 2402 124 | 3370 125 | 212 126 | 166 127 | 3472 128 | 3528 129 | 774 130 | 1152 131 | 2597 132 | 3231 133 | 524 134 | 3721 135 | 891 136 | 2516 137 | 2411 138 | 691 139 | 682 140 | 592 141 | 829 142 | 3204 143 | 396 144 | 4028 145 | 281 146 | 3824 147 | 322 148 | 2973 149 | 743 150 | 3295 151 | 2009 152 | 1178 153 | 3956 154 | 2235 155 | 3989 156 | 1513 157 | 2425 158 | 3329 159 | 795 160 | 939 161 | 1299 162 | 1454 163 | 1156 164 | 3346 165 | 2296 166 | 1126 167 | 1965 168 | 3958 169 | 1557 170 | 2266 171 | 3316 172 | 3285 173 | 2571 174 | 3622 175 | 486 176 | 3567 177 | 316 178 | 2285 179 | 1086 180 | 2697 181 | 1618 182 | 432 183 | 1925 184 | 3571 185 | 3585 186 | 1159 187 | 2825 188 | 3581 189 | 3291 190 | 47 191 | 3375 192 | 520 193 | 1601 194 | 1318 195 | 1213 196 | 364 197 | 2981 198 | 2728 199 | 1161 200 | 1932 201 | 373 202 | 834 203 | 2815 204 | 1860 205 | 3282 206 | 437 207 | 1552 208 | 1594 209 | 547 210 | 3611 211 | 153 212 | 2306 213 | 911 214 | 2050 215 | 2671 216 | 1460 217 | 2273 218 | 1260 219 | 871 220 | 2693 221 | 2053 222 | 1934 223 | 2619 224 | 2145 225 | 112 226 | 3890 227 | 2672 228 | 904 229 | 1387 230 | 2684 231 | 591 232 | 1375 233 | 1608 234 | 807 235 | 1 236 | 2190 237 | 3005 238 | 2746 239 | 106 240 | 3803 241 | 2490 242 | 3088 243 | 1947 244 | 816 245 | 1332 246 | 2157 247 | 3849 248 | 2580 249 | 276 250 | 1277 251 | 86 252 | 3632 253 | 1692 254 | 1975 255 | 1169 256 | 3669 257 | 3255 258 | 2719 259 | 2475 260 | 1966 261 | 2330 262 | 1485 263 | 3974 264 | 109 265 | 1615 266 | 3288 267 | 1468 268 | 3743 269 | 2994 270 | 3245 271 | 1013 272 | 492 273 | 374 274 | 460 275 | 2398 276 | 4105 277 | 3077 278 | 3860 279 | 3910 280 | 57 281 | 49 282 | 2575 283 | 915 284 | 1404 285 | 2686 286 | 467 287 | 3604 288 | 1082 289 | 366 290 | 2361 291 | 2401 292 | 1987 293 | 1294 294 | 1362 295 | 3814 296 | 3039 297 | 2383 298 | 474 299 | 3243 300 | 238 301 | 3764 302 | 3826 303 | 2890 304 | 1668 305 | 865 306 | 393 307 | 2925 308 | 2557 309 | 2677 310 | 2230 311 | 114 312 | 700 313 | 2030 314 | 2731 315 | 1167 316 | 2341 317 | 1368 318 | 3107 319 | 1429 320 | 2338 321 | 2596 322 | 1457 323 | 1772 324 | 3710 325 | 2933 326 | 3065 327 | 3027 328 | 3400 329 | 4032 330 | 1499 331 | 1313 332 | 1309 333 | 26 334 | 2375 335 | 1175 336 | 1448 337 | 1190 338 | 3263 339 | 3106 340 | 2831 341 | 3036 342 | 1009 343 | 170 344 | 1616 345 | 1107 346 | 3645 347 | 100 348 | 1982 349 | 291 350 | 1352 351 | 2255 352 | 129 353 | 2986 354 | 1285 355 | 2816 356 | 1825 357 | 2319 358 | 3568 359 | 2362 360 | 3707 361 | 1198 362 | 1433 363 | 2485 364 | 2718 365 | 2864 366 | 214 367 | 3063 368 | 3148 369 | 1593 370 | 522 371 | 1808 372 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-9-1.txt: -------------------------------------------------------------------------------- 1 | 1051 2 | 1930 3 | 1511 4 | 1479 5 | 3777 6 | 893 7 | 4043 8 | 3141 9 | 1493 10 | 2367 11 | 3007 12 | 965 13 | 3489 14 | 1027 15 | 1757 16 | 469 17 | 3742 18 | 3731 19 | 3546 20 | 995 21 | 1400 22 | 2294 23 | 1833 24 | 1424 25 | 1361 26 | 111 27 | 697 28 | 3868 29 | 676 30 | 874 31 | 1588 32 | 2424 33 | 2612 34 | 117 35 | 4095 36 | 1105 37 | 3813 38 | 2637 39 | 2895 40 | 2368 41 | 1592 42 | 1506 43 | 2031 44 | 2123 45 | 353 46 | 4033 47 | 2493 48 | 2455 49 | 1344 50 | 755 51 | 43 52 | 2152 53 | 4076 54 | 1430 55 | 1322 56 | 957 57 | 857 58 | 2463 59 | 1942 60 | 1886 61 | 2818 62 | 226 63 | 725 64 | 301 65 | 551 66 | 783 67 | 538 68 | 3155 69 | 2104 70 | 1287 71 | 1127 72 | 3233 73 | 3864 74 | 3468 75 | 256 76 | 2431 77 | 760 78 | 3447 79 | 1125 80 | 654 81 | 3933 82 | 3916 83 | 4097 84 | 1740 85 | 3196 86 | 2414 87 | 3494 88 | 1377 89 | 196 90 | 3045 91 | 2813 92 | 2218 93 | 2312 94 | 2148 95 | 275 96 | 2778 97 | 1940 98 | 1577 99 | 216 100 | 3862 101 | 3021 102 | 3247 103 | 483 104 | 3601 105 | 294 106 | 2088 107 | 536 108 | 1639 109 | 3271 110 | 3931 111 | 2594 112 | 797 113 | 3450 114 | 2232 115 | 2440 116 | 1301 117 | 1354 118 | 3212 119 | 416 120 | 1624 121 | 2022 122 | 1980 123 | 4054 124 | 1083 125 | 1518 126 | 1621 127 | 3113 128 | 3843 129 | 1697 130 | 3750 131 | 365 132 | 3488 133 | 3248 134 | 1413 135 | 1720 136 | 897 137 | 1378 138 | 1324 139 | 3235 140 | 2516 141 | 796 142 | 2917 143 | 281 144 | 2380 145 | 1476 146 | 1052 147 | 2452 148 | 1513 149 | 1964 150 | 156 151 | 2449 152 | 3185 153 | 2821 154 | 3752 155 | 1454 156 | 2300 157 | 1383 158 | 2187 159 | 1501 160 | 3285 161 | 2233 162 | 280 163 | 974 164 | 3622 165 | 2495 166 | 712 167 | 2712 168 | 197 169 | 2378 170 | 16 171 | 1918 172 | 3617 173 | 3625 174 | 1836 175 | 1046 176 | 1618 177 | 1398 178 | 3571 179 | 3555 180 | 1614 181 | 954 182 | 2630 183 | 262 184 | 2238 185 | 2937 186 | 2970 187 | 1923 188 | 2340 189 | 1798 190 | 457 191 | 3879 192 | 1878 193 | 147 194 | 1660 195 | 3780 196 | 2800 197 | 2189 198 | 1905 199 | 943 200 | 3635 201 | 297 202 | 2586 203 | 2638 204 | 2505 205 | 440 206 | 2510 207 | 3009 208 | 2178 209 | 764 210 | 2905 211 | 153 212 | 3142 213 | 2670 214 | 3755 215 | 1181 216 | 266 217 | 4057 218 | 1123 219 | 1250 220 | 2059 221 | 438 222 | 3073 223 | 723 224 | 3639 225 | 232 226 | 213 227 | 3557 228 | 236 229 | 3870 230 | 309 231 | 2684 232 | 2467 233 | 3471 234 | 542 235 | 1828 236 | 1502 237 | 586 238 | 3354 239 | 1394 240 | 1967 241 | 3168 242 | 3501 243 | 707 244 | 132 245 | 3853 246 | 1632 247 | 673 248 | 3684 249 | 827 250 | 2881 251 | 2002 252 | 4019 253 | 785 254 | 2426 255 | 1212 256 | 223 257 | 3976 258 | 1253 259 | 1760 260 | 1056 261 | 2647 262 | 936 263 | 272 264 | 1435 265 | 3416 266 | 2987 267 | 1416 268 | 1202 269 | 2659 270 | 1658 271 | 1357 272 | 3531 273 | 1684 274 | 2854 275 | 3070 276 | 2710 277 | 2879 278 | 549 279 | 1804 280 | 1770 281 | 2045 282 | 2369 283 | 1810 284 | 2723 285 | 1220 286 | 2430 287 | 4094 288 | 2114 289 | 2275 290 | 2242 291 | 1519 292 | 3605 293 | 510 294 | 1999 295 | 2896 296 | 2691 297 | 66 298 | 3632 299 | 3748 300 | 1335 301 | 2159 302 | 3419 303 | 1741 304 | 910 305 | 1353 306 | 1538 307 | 225 308 | 3936 309 | 3827 310 | 3922 311 | 1953 312 | 2149 313 | 2771 314 | 1602 315 | 2168 316 | 3394 317 | 1349 318 | 1765 319 | 611 320 | 2221 321 | 2025 322 | 3317 323 | 1076 324 | 1991 325 | 2919 326 | 1445 327 | 1568 328 | 3769 329 | 2535 330 | 3093 331 | 1064 332 | 1610 333 | 3017 334 | 1746 335 | 3863 336 | 2906 337 | 3404 338 | 521 339 | 651 340 | 745 341 | 3479 342 | 1091 343 | 1846 344 | 2160 345 | 1351 346 | 778 347 | 2876 348 | 663 349 | 3314 350 | 1768 351 | 2869 352 | 159 353 | 3592 354 | 4103 355 | 3966 356 | 1984 357 | 716 358 | 3652 359 | 2457 360 | 2792 361 | 3895 362 | 446 363 | 2860 364 | 371 365 | 2013 366 | 3368 367 | 152 368 | 3304 369 | 199 370 | 2832 371 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/inner_folds/val_idx-10-1.txt: -------------------------------------------------------------------------------- 1 | 1247 2 | 3723 3 | 633 4 | 4084 5 | 1497 6 | 3682 7 | 2664 8 | 2465 9 | 1889 10 | 2512 11 | 2299 12 | 1694 13 | 3399 14 | 1027 15 | 1716 16 | 3701 17 | 2076 18 | 1757 19 | 2010 20 | 617 21 | 3918 22 | 2135 23 | 1053 24 | 2583 25 | 463 26 | 2254 27 | 1424 28 | 1201 29 | 3483 30 | 1227 31 | 2322 32 | 3323 33 | 3051 34 | 2810 35 | 2109 36 | 676 37 | 2695 38 | 3802 39 | 3187 40 | 899 41 | 564 42 | 2031 43 | 3753 44 | 4076 45 | 1348 46 | 3736 47 | 570 48 | 845 49 | 284 50 | 1302 51 | 1900 52 | 1408 53 | 421 54 | 1886 55 | 2363 56 | 1978 57 | 582 58 | 625 59 | 1799 60 | 2589 61 | 210 62 | 1567 63 | 3059 64 | 4013 65 | 555 66 | 1924 67 | 2641 68 | 3903 69 | 3019 70 | 794 71 | 239 72 | 3519 73 | 515 74 | 3117 75 | 3447 76 | 2863 77 | 1117 78 | 2995 79 | 2529 80 | 3792 81 | 3339 82 | 2271 83 | 3190 84 | 656 85 | 1688 86 | 1611 87 | 1586 88 | 3167 89 | 823 90 | 3164 91 | 1118 92 | 351 93 | 3735 94 | 2337 95 | 1868 96 | 1381 97 | 1341 98 | 2199 99 | 908 100 | 2313 101 | 2590 102 | 1142 103 | 1388 104 | 1881 105 | 3795 106 | 2423 107 | 600 108 | 596 109 | 3719 110 | 3021 111 | 483 112 | 1259 113 | 2043 114 | 31 115 | 3301 116 | 2898 117 | 4061 118 | 91 119 | 1639 120 | 3804 121 | 2035 122 | 3659 123 | 2388 124 | 2226 125 | 2232 126 | 2908 127 | 3212 128 | 2443 129 | 4041 130 | 2674 131 | 3270 132 | 3373 133 | 72 134 | 3370 135 | 1591 136 | 3843 137 | 1147 138 | 205 139 | 2074 140 | 1088 141 | 3050 142 | 2797 143 | 3972 144 | 482 145 | 524 146 | 2436 147 | 3821 148 | 3721 149 | 646 150 | 2239 151 | 433 152 | 2645 153 | 2777 154 | 3927 155 | 796 156 | 944 157 | 3133 158 | 3230 159 | 58 160 | 355 161 | 1376 162 | 3964 163 | 4092 164 | 667 165 | 2631 166 | 3433 167 | 1052 168 | 1816 169 | 2850 170 | 3363 171 | 156 172 | 2862 173 | 955 174 | 2694 175 | 831 176 | 1393 177 | 1149 178 | 1071 179 | 998 180 | 3951 181 | 2907 182 | 3209 183 | 2564 184 | 403 185 | 565 186 | 1018 187 | 3706 188 | 558 189 | 3344 190 | 3405 191 | 3541 192 | 2094 193 | 2915 194 | 486 195 | 2495 196 | 3889 197 | 1880 198 | 3596 199 | 4026 200 | 1618 201 | 1130 202 | 3130 203 | 2498 204 | 2974 205 | 1835 206 | 554 207 | 2036 208 | 3291 209 | 34 210 | 3851 211 | 47 212 | 3837 213 | 1755 214 | 1004 215 | 3791 216 | 1726 217 | 3421 218 | 184 219 | 689 220 | 1842 221 | 3673 222 | 2962 223 | 230 224 | 2071 225 | 3487 226 | 3435 227 | 3475 228 | 445 229 | 2706 230 | 1270 231 | 1298 232 | 1312 233 | 3360 234 | 2178 235 | 252 236 | 2051 237 | 2165 238 | 1504 239 | 3025 240 | 136 241 | 3749 242 | 3993 243 | 1793 244 | 3789 245 | 1132 246 | 2393 247 | 4016 248 | 309 249 | 591 250 | 1295 251 | 2144 252 | 2190 253 | 3000 254 | 1735 255 | 3516 256 | 3128 257 | 860 258 | 1006 259 | 1524 260 | 2965 261 | 3028 262 | 20 263 | 2602 264 | 2390 265 | 539 266 | 367 267 | 2720 268 | 2392 269 | 1525 270 | 1249 271 | 677 272 | 4036 273 | 1893 274 | 285 275 | 3527 276 | 2711 277 | 1500 278 | 580 279 | 3675 280 | 1581 281 | 1589 282 | 1490 283 | 3299 284 | 1677 285 | 2932 286 | 2237 287 | 1226 288 | 3275 289 | 4085 290 | 1220 291 | 1519 292 | 3112 293 | 1548 294 | 3992 295 | 751 296 | 10 297 | 1769 298 | 752 299 | 1988 300 | 3252 301 | 1637 302 | 2321 303 | 1029 304 | 4096 305 | 3419 306 | 201 307 | 3102 308 | 3417 309 | 3572 310 | 2200 311 | 1199 312 | 1468 313 | 225 314 | 3743 315 | 2334 316 | 1210 317 | 3626 318 | 2326 319 | 3936 320 | 332 321 | 1671 322 | 2940 323 | 2740 324 | 57 325 | 2916 326 | 801 327 | 2395 328 | 1084 329 | 1931 330 | 1330 331 | 2462 332 | 4063 333 | 3695 334 | 3317 335 | 2477 336 | 1076 337 | 2026 338 | 268 339 | 1054 340 | 461 341 | 1568 342 | 2291 343 | 2241 344 | 2545 345 | 2920 346 | 1362 347 | 3876 348 | 2914 349 | 3039 350 | 839 351 | 976 352 | 3941 353 | 3939 354 | 756 355 | 2562 356 | 562 357 | 826 358 | 579 359 | 361 360 | 2212 361 | 3518 362 | 3462 363 | 1308 364 | 1325 365 | 1205 366 | 674 367 | 2596 368 | 1993 369 | 597 370 | 3478 371 | 1281 372 | -------------------------------------------------------------------------------- /gckn/gckn_fast/gckn_fast_cuda_kernel.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace { 4 | template 5 | __global__ void path_conv_forward_cuda_kernel( 6 | scalar_t* __restrict__ output, 7 | const int64_t* __restrict__ path_indices, 8 | const scalar_t* __restrict__ features, 9 | int64_t n_paths, 10 | int64_t path_size, 11 | int64_t feat_path_size, 12 | int64_t hidden_size) { 13 | 14 | const int row = blockIdx.x * blockDim.x + threadIdx.x; 15 | const int col = blockIdx.y; 16 | const int index = row * hidden_size + col; 17 | scalar_t val = 1. / path_size; 18 | int64_t node_idx; 19 | 20 | if (col < hidden_size && row < n_paths) { 21 | for (int64_t j = 0; j < path_size; ++j){ 22 | node_idx = path_indices[row * path_size + j]; 23 | output[index] += val * features[(node_idx * feat_path_size + j) * hidden_size + col]; 24 | } 25 | } 26 | 27 | } 28 | 29 | template 30 | __global__ void path_conv_backward_cuda_kernel( 31 | scalar_t* __restrict__ d_input, 32 | const int64_t* __restrict__ path_indices, 33 | const scalar_t* __restrict__ d_output, 34 | int64_t n_paths, 35 | int64_t path_size, 36 | int64_t feat_path_size, 37 | int64_t hidden_size) { 38 | 39 | const int row = blockIdx.x * blockDim.x + threadIdx.x; 40 | const int col = blockIdx.y; 41 | const int index = row * hidden_size + col; 42 | scalar_t val = 1. / path_size; 43 | int64_t node_idx; 44 | 45 | if (col < hidden_size && row < n_paths) { 46 | for (int64_t j = 0; j < path_size; ++j){ 47 | node_idx = path_indices[row * path_size + j]; 48 | d_input[(node_idx * feat_path_size + j) * hidden_size + col] += val * d_output[index]; 49 | } 50 | } 51 | 52 | } 53 | 54 | } 55 | 56 | torch::Tensor path_conv_forward_cuda( 57 | torch::Tensor path_indices, 58 | torch::Tensor features) { 59 | // path_indices: n_paths x path_size (value < n_nodes) 60 | // features: n_nodes x path_size x hidden_size x (in_path_size) 61 | // output: n_paths x hidden_size x (in_path_size) 62 | const int64_t n_paths = path_indices.size(0); 63 | const int64_t path_size = path_indices.size(1); 64 | const int64_t feat_path_size = features.size(1); 65 | const int64_t hidden_size = features.size(2); 66 | 67 | auto output = torch::zeros({n_paths, hidden_size}, features.options()); 68 | 69 | const int threads = 1024; 70 | const dim3 blocks((n_paths + threads - 1) / threads, hidden_size); 71 | 72 | AT_DISPATCH_FLOATING_TYPES(features.type(), "path_conv_forward_cuda", ([&] { 73 | path_conv_forward_cuda_kernel<<>>( 74 | output.data_ptr(), 75 | path_indices.data_ptr(), 76 | features.data_ptr(), 77 | n_paths, 78 | path_size, 79 | feat_path_size, 80 | hidden_size); 81 | })); 82 | 83 | return output; 84 | } 85 | 86 | void path_conv_backward_cuda( 87 | torch::Tensor d_input, 88 | torch::Tensor d_output, 89 | torch::Tensor path_indices) { 90 | const int64_t n_paths = path_indices.size(0); 91 | const int64_t path_size = path_indices.size(1); 92 | const int64_t feat_path_size = d_input.size(1); 93 | const int64_t hidden_size = d_output.size(1); 94 | 95 | // auto commonDtype = promoteTypes(d_input.scalar_type(), d_output.scalar_type()); 96 | 97 | const int threads = 1024; 98 | const dim3 blocks((n_paths + threads - 1) / threads, hidden_size); 99 | 100 | AT_DISPATCH_FLOATING_TYPES(d_output.type(), "path_conv_backward_cuda", ([&] { 101 | path_conv_backward_cuda_kernel<<>>( 102 | d_input.data_ptr(), 103 | path_indices.data_ptr(), 104 | d_output.data_ptr(), 105 | n_paths, 106 | path_size, 107 | feat_path_size, 108 | hidden_size); 109 | })); 110 | } 111 | 112 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-2.txt: -------------------------------------------------------------------------------- 1 | 3426 2 | 2493 3 | 2943 4 | 1788 5 | 3238 6 | 1461 7 | 1120 8 | 1070 9 | 3897 10 | 3861 11 | 2758 12 | 1649 13 | 2405 14 | 1579 15 | 221 16 | 1763 17 | 647 18 | 2037 19 | 1036 20 | 1422 21 | 179 22 | 970 23 | 3856 24 | 2871 25 | 1901 26 | 2138 27 | 3753 28 | 2455 29 | 3352 30 | 3096 31 | 3771 32 | 32 33 | 2162 34 | 1087 35 | 1344 36 | 427 37 | 755 38 | 3523 39 | 43 40 | 1832 41 | 2152 42 | 1950 43 | 1687 44 | 692 45 | 1431 46 | 1136 47 | 557 48 | 458 49 | 1817 50 | 4076 51 | 48 52 | 110 53 | 1348 54 | 3736 55 | 2524 56 | 3277 57 | 3188 58 | 1068 59 | 3954 60 | 570 61 | 1430 62 | 1322 63 | 1391 64 | 845 65 | 957 66 | 369 67 | 2284 68 | 3809 69 | 1360 70 | 3545 71 | 3443 72 | 284 73 | 1302 74 | 411 75 | 490 76 | 1516 77 | 2034 78 | 857 79 | 3095 80 | 1111 81 | 653 82 | 1900 83 | 1148 84 | 3888 85 | 1712 86 | 1495 87 | 3907 88 | 2463 89 | 1942 90 | 1410 91 | 1274 92 | 2667 93 | 1408 94 | 1928 95 | 1224 96 | 1019 97 | 980 98 | 3372 99 | 1914 100 | 421 101 | 62 102 | 1155 103 | 1886 104 | 1721 105 | 2713 106 | 1994 107 | 1171 108 | 3779 109 | 2733 110 | 2363 111 | 3806 112 | 6 113 | 3422 114 | 3934 115 | 2818 116 | 1656 117 | 3676 118 | 3631 119 | 1978 120 | 582 121 | 3744 122 | 625 123 | 226 124 | 3381 125 | 3365 126 | 2598 127 | 4018 128 | 1288 129 | 2177 130 | 3663 131 | 1629 132 | 3090 133 | 762 134 | 717 135 | 1273 136 | 1799 137 | 2589 138 | 1607 139 | 1752 140 | 3558 141 | 87 142 | 988 143 | 2480 144 | 725 145 | 210 146 | 983 147 | 4010 148 | 4081 149 | 3203 150 | 301 151 | 3563 152 | 791 153 | 551 154 | 1989 155 | 1724 156 | 1944 157 | 3386 158 | 1708 159 | 2724 160 | 1007 161 | 3202 162 | 386 163 | 1252 164 | 3283 165 | 2960 166 | 3593 167 | 1158 168 | 293 169 | 3599 170 | 1739 171 | 3773 172 | 218 173 | 3294 174 | 989 175 | 1567 176 | 3059 177 | 914 178 | 24 179 | 2374 180 | 3428 181 | 3547 182 | 504 183 | 783 184 | 538 185 | 1187 186 | 3137 187 | 3674 188 | 3906 189 | 243 190 | 2408 191 | 2176 192 | 191 193 | 552 194 | 1598 195 | 1647 196 | 1600 197 | 2747 198 | 1269 199 | 2646 200 | 1384 201 | 4013 202 | 3155 203 | 555 204 | 1924 205 | 695 206 | 2104 207 | 3357 208 | 11 209 | 3892 210 | 4020 211 | 306 212 | 2641 213 | 338 214 | 4040 215 | 3903 216 | 3274 217 | 1287 218 | 150 219 | 3891 220 | 3019 221 | 2587 222 | 710 223 | 2889 224 | 890 225 | 2980 226 | 3703 227 | 360 228 | 794 229 | 3691 230 | 2450 231 | 2985 232 | 537 233 | 1127 234 | 494 235 | 1851 236 | 239 237 | 3233 238 | 54 239 | 44 240 | 2620 241 | 655 242 | 2118 243 | 1549 244 | 1544 245 | 3990 246 | 380 247 | 3641 248 | 175 249 | 935 250 | 2574 251 | 2047 252 | 3864 253 | 1180 254 | 2811 255 | 3468 256 | 1072 257 | 1784 258 | 861 259 | 3519 260 | 1473 261 | 256 262 | 188 263 | 744 264 | 2213 265 | 3504 266 | 3218 267 | 515 268 | 3646 269 | 2268 270 | 2431 271 | 760 272 | 23 273 | 3117 274 | 3998 275 | 2805 276 | 3447 277 | 92 278 | 2844 279 | 2420 280 | 4099 281 | 528 282 | 2863 283 | 1117 284 | 851 285 | 161 286 | 1962 287 | 2497 288 | 2563 289 | 77 290 | 2969 291 | 2531 292 | 308 293 | 1125 294 | 164 295 | 2682 296 | 599 297 | 2859 298 | 566 299 | 3513 300 | 3261 301 | 4001 302 | 2080 303 | 1625 304 | 1196 305 | 2995 306 | 2529 307 | 2660 308 | 2032 309 | 1749 310 | 3549 311 | 1576 312 | 734 313 | 1963 314 | 3040 315 | 485 316 | 1359 317 | 1523 318 | 2466 319 | 3978 320 | 1426 321 | 3792 322 | 3403 323 | 3928 324 | 2310 325 | 1139 326 | 879 327 | 3201 328 | 2433 329 | 3197 330 | 3339 331 | 2271 332 | 2617 333 | 1425 334 | 3335 335 | 3409 336 | 1075 337 | 2877 338 | 241 339 | 3131 340 | 1830 341 | 3778 342 | 3222 343 | 414 344 | 1409 345 | 2048 346 | 2142 347 | 329 348 | 2274 349 | 108 350 | 3129 351 | 3038 352 | 544 353 | 833 354 | 1955 355 | 2018 356 | 3108 357 | 1909 358 | 4035 359 | 540 360 | 3190 361 | 656 362 | 3456 363 | 654 364 | 3362 365 | 1515 366 | 894 367 | 429 368 | 296 369 | 3933 370 | 1211 371 | 1834 372 | 1012 373 | 2282 374 | 884 375 | 3916 376 | 1280 377 | 2582 378 | 3845 379 | 4097 380 | 3885 381 | 850 382 | 1414 383 | 3660 384 | 2739 385 | 315 386 | 70 387 | 3391 388 | 3606 389 | 3104 390 | 2494 391 | 1688 392 | 956 393 | 3454 394 | 2692 395 | 1740 396 | 2422 397 | 3250 398 | 2525 399 | 610 400 | 1166 401 | 1611 402 | 543 403 | 3602 404 | 1586 405 | 1606 406 | 465 407 | 972 408 | 1340 409 | 830 410 | 3948 411 | 1077 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-10.txt: -------------------------------------------------------------------------------- 1 | 26 2 | 688 3 | 3651 4 | 561 5 | 2174 6 | 479 7 | 541 8 | 991 9 | 2375 10 | 1315 11 | 3769 12 | 2304 13 | 1175 14 | 532 15 | 3110 16 | 2535 17 | 2511 18 | 1448 19 | 2830 20 | 3269 21 | 222 22 | 3740 23 | 1379 24 | 1369 25 | 1190 26 | 3263 27 | 1411 28 | 3830 29 | 1534 30 | 3093 31 | 2350 32 | 513 33 | 2444 34 | 1064 35 | 1750 36 | 1884 37 | 2990 38 | 2153 39 | 967 40 | 1610 41 | 113 42 | 3331 43 | 870 44 | 3106 45 | 3017 46 | 3440 47 | 2831 48 | 2288 49 | 2342 50 | 89 51 | 2387 52 | 3036 53 | 2027 54 | 279 55 | 1238 56 | 2023 57 | 2848 58 | 2946 59 | 1746 60 | 1009 61 | 3863 62 | 2906 63 | 2201 64 | 2245 65 | 840 66 | 170 67 | 1095 68 | 2382 69 | 2560 70 | 2011 71 | 1838 72 | 3734 73 | 624 74 | 1854 75 | 3766 76 | 3551 77 | 917 78 | 4100 79 | 3783 80 | 2936 81 | 979 82 | 1779 83 | 407 84 | 3340 85 | 331 86 | 4037 87 | 3480 88 | 1831 89 | 3404 90 | 133 91 | 3259 92 | 521 93 | 1616 94 | 1654 95 | 3465 96 | 3442 97 | 3526 98 | 3046 99 | 651 100 | 395 101 | 1635 102 | 2939 103 | 745 104 | 1022 105 | 507 106 | 39 107 | 4060 108 | 3479 109 | 1186 110 | 2052 111 | 2115 112 | 503 113 | 455 114 | 1107 115 | 2499 116 | 2770 117 | 940 118 | 1715 119 | 981 120 | 3524 121 | 419 122 | 1023 123 | 428 124 | 3603 125 | 3538 126 | 418 127 | 3645 128 | 2534 129 | 2762 130 | 100 131 | 75 132 | 1091 133 | 1163 134 | 2561 135 | 1392 136 | 204 137 | 3833 138 | 3054 139 | 1982 140 | 1846 141 | 2160 142 | 2949 143 | 2281 144 | 1351 145 | 2236 146 | 3811 147 | 778 148 | 777 149 | 2518 150 | 318 151 | 244 152 | 3092 153 | 2876 154 | 706 155 | 663 156 | 3134 157 | 613 158 | 1317 159 | 1183 160 | 1844 161 | 3621 162 | 1562 163 | 299 164 | 291 165 | 1985 166 | 4022 167 | 810 168 | 918 169 | 3257 170 | 1110 171 | 1124 172 | 2063 173 | 1094 174 | 1057 175 | 1419 176 | 1352 177 | 1192 178 | 3957 179 | 2780 180 | 1217 181 | 3011 182 | 3193 183 | 3314 184 | 1421 185 | 3366 186 | 1096 187 | 426 188 | 481 189 | 3498 190 | 1364 191 | 2702 192 | 2743 193 | 3083 194 | 4044 195 | 731 196 | 2573 197 | 2772 198 | 748 199 | 567 200 | 3448 201 | 141 202 | 1865 203 | 1768 204 | 2763 205 | 1035 206 | 1328 207 | 2704 208 | 2418 209 | 2856 210 | 13 211 | 2869 212 | 159 213 | 1471 214 | 3592 215 | 2311 216 | 1564 217 | 2332 218 | 968 219 | 3768 220 | 3658 221 | 4103 222 | 2255 223 | 129 224 | 3423 225 | 2532 226 | 2175 227 | 1550 228 | 3737 229 | 2108 230 | 853 231 | 1401 232 | 2999 233 | 118 234 | 3116 235 | 3966 236 | 828 237 | 3034 238 | 4075 239 | 52 240 | 412 241 | 4059 242 | 729 243 | 2649 244 | 5 245 | 1283 246 | 3355 247 | 3762 248 | 79 249 | 2492 250 | 2986 251 | 3067 252 | 3469 253 | 3376 254 | 2880 255 | 1984 256 | 716 257 | 3006 258 | 2519 259 | 3652 260 | 1285 261 | 2457 262 | 4055 263 | 3556 264 | 397 265 | 4069 266 | 516 267 | 2798 268 | 1958 269 | 3638 270 | 3490 271 | 773 272 | 848 273 | 3670 274 | 1802 275 | 1144 276 | 2792 277 | 2816 278 | 2900 279 | 952 280 | 2874 281 | 3326 282 | 1825 283 | 746 284 | 1631 285 | 1042 286 | 2125 287 | 2085 288 | 3570 289 | 2249 290 | 3895 291 | 446 292 | 3321 293 | 726 294 | 1044 295 | 506 296 | 1946 297 | 3600 298 | 2860 299 | 2836 300 | 3553 301 | 2904 302 | 3729 303 | 2319 304 | 4024 305 | 3568 306 | 3328 307 | 2362 308 | 2267 309 | 672 310 | 371 311 | 1856 312 | 2469 313 | 3525 314 | 701 315 | 2064 316 | 679 317 | 121 318 | 1498 319 | 2491 320 | 3536 321 | 283 322 | 1722 323 | 3336 324 | 180 325 | 3707 326 | 1256 327 | 730 328 | 2013 329 | 1857 330 | 928 331 | 2488 332 | 2240 333 | 1783 334 | 1198 335 | 1433 336 | 1407 337 | 1492 338 | 916 339 | 4067 340 | 1055 341 | 3026 342 | 3562 343 | 3052 344 | 2485 345 | 3982 346 | 693 347 | 3866 348 | 977 349 | 3361 350 | 3030 351 | 1812 352 | 430 353 | 2774 354 | 2377 355 | 1634 356 | 1676 357 | 2945 358 | 2501 359 | 2092 360 | 2718 361 | 1179 362 | 728 363 | 3745 364 | 2864 365 | 157 366 | 3368 367 | 214 368 | 2339 369 | 152 370 | 635 371 | 3455 372 | 727 373 | 2381 374 | 920 375 | 3063 376 | 300 377 | 3148 378 | 2097 379 | 2394 380 | 2315 381 | 2205 382 | 3427 383 | 2584 384 | 1910 385 | 3307 386 | 3287 387 | 858 388 | 1617 389 | 2262 390 | 1593 391 | 30 392 | 1230 393 | 1696 394 | 2504 395 | 2789 396 | 8 397 | 2070 398 | 2500 399 | 3937 400 | 2129 401 | 2351 402 | 345 403 | 1403 404 | 522 405 | 1728 406 | 644 407 | 3304 408 | 3800 409 | 199 410 | 1808 411 | 2832 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-7.txt: -------------------------------------------------------------------------------- 1 | 1316 2 | 860 3 | 3550 4 | 3997 5 | 1937 6 | 889 7 | 3842 8 | 1481 9 | 1006 10 | 648 11 | 3420 12 | 3684 13 | 827 14 | 3510 15 | 292 16 | 269 17 | 2336 18 | 1945 19 | 2884 20 | 4102 21 | 1883 22 | 2397 23 | 2881 24 | 3237 25 | 2147 26 | 55 27 | 3574 28 | 3345 29 | 1016 30 | 1524 31 | 2934 32 | 1453 33 | 1911 34 | 2768 35 | 2965 36 | 585 37 | 471 38 | 3028 39 | 3445 40 | 1628 41 | 3374 42 | 629 43 | 2002 44 | 3767 45 | 1372 46 | 320 47 | 2851 48 | 1150 49 | 2956 50 | 559 51 | 69 52 | 2875 53 | 708 54 | 20 55 | 3688 56 | 4019 57 | 3962 58 | 1172 59 | 2759 60 | 3432 61 | 434 62 | 785 63 | 3871 64 | 2269 65 | 1191 66 | 1477 67 | 254 68 | 19 69 | 2270 70 | 892 71 | 2602 72 | 945 73 | 3457 74 | 4093 75 | 420 76 | 3901 77 | 1775 78 | 1397 79 | 3694 80 | 1331 81 | 2426 82 | 405 83 | 2827 84 | 3636 85 | 2533 86 | 2390 87 | 2983 88 | 2008 89 | 1870 90 | 3211 91 | 1345 92 | 1185 93 | 3219 94 | 2517 95 | 2735 96 | 3147 97 | 662 98 | 2163 99 | 553 100 | 539 101 | 367 102 | 442 103 | 3836 104 | 231 105 | 3364 106 | 1244 107 | 3722 108 | 263 109 | 61 110 | 45 111 | 3172 112 | 3880 113 | 2840 114 | 3580 115 | 3210 116 | 3424 117 | 1723 118 | 1374 119 | 1212 120 | 2720 121 | 223 122 | 3976 123 | 1919 124 | 394 125 | 1216 126 | 4079 127 | 1420 128 | 1049 129 | 4049 130 | 1253 131 | 1760 132 | 3576 133 | 1056 134 | 3607 135 | 3807 136 | 1747 137 | 2647 138 | 82 139 | 1366 140 | 936 141 | 64 142 | 3395 143 | 242 144 | 3950 145 | 809 146 | 2941 147 | 272 148 | 2392 149 | 2954 150 | 2416 151 | 363 152 | 1435 153 | 2729 154 | 3559 155 | 750 156 | 4046 157 | 3416 158 | 1140 159 | 2437 160 | 3343 161 | 2987 162 | 349 163 | 1416 164 | 3823 165 | 1202 166 | 1805 167 | 2643 168 | 195 169 | 2554 170 | 1977 171 | 1525 172 | 2523 173 | 3303 174 | 2855 175 | 2314 176 | 1249 177 | 677 178 | 4036 179 | 621 180 | 1893 181 | 4086 182 | 811 183 | 1438 184 | 2659 185 | 1658 186 | 3512 187 | 1357 188 | 3531 189 | 1979 190 | 3855 191 | 1441 192 | 949 193 | 1097 194 | 2766 195 | 2824 196 | 2963 197 | 3408 198 | 1033 199 | 798 200 | 3920 201 | 181 202 | 3305 203 | 1829 204 | 495 205 | 2366 206 | 1168 207 | 1917 208 | 2610 209 | 3589 210 | 3732 211 | 1449 212 | 410 213 | 3520 214 | 285 215 | 3527 216 | 1599 217 | 3053 218 | 2353 219 | 1275 220 | 342 221 | 1761 222 | 650 223 | 452 224 | 2711 225 | 408 226 | 1684 227 | 2404 228 | 1507 229 | 2854 230 | 3200 231 | 120 232 | 841 233 | 3070 234 | 1500 235 | 2786 236 | 2435 237 | 3023 238 | 2861 239 | 595 240 | 769 241 | 317 242 | 2710 243 | 698 244 | 3160 245 | 119 246 | 182 247 | 2272 248 | 425 249 | 859 250 | 580 251 | 3733 252 | 2791 253 | 2613 254 | 2179 255 | 883 256 | 3251 257 | 2107 258 | 546 259 | 3808 260 | 2016 261 | 2316 262 | 3411 263 | 2879 264 | 4007 265 | 3686 266 | 549 267 | 341 268 | 1804 269 | 3015 270 | 169 271 | 2384 272 | 718 273 | 2537 274 | 1770 275 | 1242 276 | 2045 277 | 641 278 | 3675 279 | 1581 280 | 1589 281 | 1520 282 | 2134 283 | 1929 284 | 3640 285 | 1490 286 | 381 287 | 1638 288 | 398 289 | 3299 290 | 1677 291 | 2220 292 | 3127 293 | 3588 294 | 4030 295 | 2865 296 | 2858 297 | 29 298 | 1887 299 | 2932 300 | 3618 301 | 1143 302 | 2369 303 | 2237 304 | 997 305 | 1952 306 | 1810 307 | 3109 308 | 1226 309 | 1571 310 | 137 311 | 3163 312 | 3935 313 | 846 314 | 126 315 | 508 316 | 2438 317 | 73 318 | 2547 319 | 295 320 | 3275 321 | 3968 322 | 2723 323 | 2951 324 | 3268 325 | 735 326 | 3122 327 | 2139 328 | 4 329 | 4085 330 | 806 331 | 1220 332 | 1992 333 | 3418 334 | 3689 335 | 2828 336 | 2764 337 | 389 338 | 2430 339 | 1973 340 | 2028 341 | 3066 342 | 1643 343 | 1141 344 | 3290 345 | 4094 346 | 319 347 | 3586 348 | 2464 349 | 502 350 | 2114 351 | 1906 352 | 1109 353 | 2041 354 | 2275 355 | 1691 356 | 1859 357 | 9 358 | 451 359 | 3915 360 | 2581 361 | 2242 362 | 1519 363 | 2803 364 | 3112 365 | 1099 366 | 2225 367 | 1548 368 | 703 369 | 1020 370 | 3717 371 | 2754 372 | 3874 373 | 2054 374 | 1871 375 | 1314 376 | 1700 377 | 3256 378 | 932 379 | 1486 380 | 1204 381 | 3758 382 | 1933 383 | 3605 384 | 510 385 | 3992 386 | 2120 387 | 2698 388 | 1999 389 | 751 390 | 2413 391 | 2982 392 | 310 393 | 3509 394 | 2073 395 | 2359 396 | 2767 397 | 2370 398 | 123 399 | 3561 400 | 10 401 | 1769 402 | 59 403 | 3207 404 | 1888 405 | 3008 406 | 2605 407 | 752 408 | 2896 409 | 2834 410 | 2757 411 | 1443 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-3.txt: -------------------------------------------------------------------------------- 1 | 3414 2 | 3180 3 | 1505 4 | 1669 5 | 1151 6 | 902 7 | 3167 8 | 2550 9 | 3118 10 | 1533 11 | 1996 12 | 2102 13 | 3284 14 | 823 15 | 3164 16 | 3166 17 | 581 18 | 1590 19 | 198 20 | 2709 21 | 501 22 | 2878 23 | 2089 24 | 2210 25 | 409 26 | 3881 27 | 1402 28 | 1118 29 | 1522 30 | 2515 31 | 1327 32 | 3196 33 | 1048 34 | 1551 35 | 2609 36 | 652 37 | 1104 38 | 3946 39 | 2891 40 | 1065 41 | 2265 42 | 2131 43 | 2414 44 | 3494 45 | 518 46 | 1291 47 | 898 48 | 3099 49 | 3522 50 | 323 51 | 1699 52 | 1709 53 | 1484 54 | 351 55 | 1530 56 | 2434 57 | 436 58 | 1787 59 | 1045 60 | 2442 61 | 2998 62 | 3735 63 | 2117 64 | 415 65 | 142 66 | 3208 67 | 2215 68 | 1664 69 | 2522 70 | 60 71 | 2337 72 | 1512 73 | 1868 74 | 1377 75 | 1254 76 | 2627 77 | 196 78 | 2252 79 | 3045 80 | 2813 81 | 2548 82 | 616 83 | 3788 84 | 1231 85 | 1997 86 | 1060 87 | 1558 88 | 2688 89 | 2841 90 | 2508 91 | 819 92 | 3249 93 | 2218 94 | 3114 95 | 4062 96 | 472 97 | 3087 98 | 2194 99 | 78 100 | 1553 101 | 2312 102 | 987 103 | 2470 104 | 2559 105 | 1381 106 | 1011 107 | 3818 108 | 3351 109 | 3847 110 | 2331 111 | 1341 112 | 2926 113 | 1913 114 | 2769 115 | 2984 116 | 3798 117 | 1268 118 | 921 119 | 1203 120 | 3048 121 | 209 122 | 1882 123 | 2852 124 | 3537 125 | 1792 126 | 1494 127 | 1971 128 | 2199 129 | 2148 130 | 614 131 | 468 132 | 3267 133 | 2429 134 | 2935 135 | 385 136 | 3279 137 | 3105 138 | 290 139 | 2400 140 | 3484 141 | 705 142 | 2570 143 | 1396 144 | 275 145 | 908 146 | 1093 147 | 1489 148 | 2778 149 | 2313 150 | 2590 151 | 3313 152 | 3296 153 | 1940 154 | 3672 155 | 3101 156 | 2894 157 | 1142 158 | 1527 159 | 2302 160 | 1777 161 | 3311 162 | 686 163 | 138 164 | 2624 165 | 3977 166 | 2897 167 | 3852 168 | 1577 169 | 1388 170 | 1221 171 | 587 172 | 1899 173 | 1877 174 | 1222 175 | 216 176 | 2484 177 | 632 178 | 2513 179 | 85 180 | 699 181 | 475 182 | 1881 183 | 3795 184 | 1282 185 | 2423 186 | 768 187 | 1078 188 | 97 189 | 600 190 | 3862 191 | 2727 192 | 3075 193 | 270 194 | 3165 195 | 3491 196 | 3653 197 | 2309 198 | 596 199 | 3308 200 | 2927 201 | 3719 202 | 3647 203 | 3056 204 | 1578 205 | 183 206 | 3021 207 | 855 208 | 3126 209 | 749 210 | 3247 211 | 4083 212 | 2607 213 | 194 214 | 765 215 | 483 216 | 103 217 | 1434 218 | 1043 219 | 2749 220 | 1451 221 | 1657 222 | 817 223 | 3485 224 | 2737 225 | 443 226 | 3627 227 | 1803 228 | 922 229 | 3772 230 | 2601 231 | 963 232 | 1259 233 | 352 234 | 3709 235 | 971 236 | 2043 237 | 3350 238 | 4068 239 | 3601 240 | 1681 241 | 294 242 | 2280 243 | 1122 244 | 31 245 | 3315 246 | 903 247 | 3071 248 | 3301 249 | 253 250 | 2088 251 | 3609 252 | 3832 253 | 882 254 | 782 255 | 304 256 | 2216 257 | 1214 258 | 2898 259 | 1785 260 | 362 261 | 628 262 | 127 263 | 1762 264 | 101 265 | 313 266 | 46 267 | 496 268 | 4061 269 | 2021 270 | 2110 271 | 536 272 | 91 273 | 3975 274 | 1639 275 | 3804 276 | 3319 277 | 3382 278 | 3594 279 | 2318 280 | 2195 281 | 1138 282 | 2538 283 | 1744 284 | 3459 285 | 3904 286 | 3271 287 | 3714 288 | 1791 289 | 3931 290 | 3310 291 | 3241 292 | 3544 293 | 3575 294 | 3260 295 | 2835 296 | 311 297 | 2594 298 | 1496 299 | 2708 300 | 3390 301 | 2035 302 | 704 303 | 3659 304 | 4082 305 | 186 306 | 3125 307 | 3452 308 | 2388 309 | 1948 310 | 797 311 | 1983 312 | 2226 313 | 3342 314 | 41 315 | 1069 316 | 2687 317 | 2259 318 | 265 319 | 1258 320 | 1170 321 | 2651 322 | 3765 323 | 3153 324 | 1575 325 | 669 326 | 2741 327 | 1039 328 | 3450 329 | 2232 330 | 2150 331 | 1297 332 | 3035 333 | 3822 334 | 2542 335 | 2947 336 | 2067 337 | 2101 338 | 3154 339 | 2908 340 | 2440 341 | 1301 342 | 3220 343 | 401 344 | 372 345 | 3610 346 | 3286 347 | 417 348 | 926 349 | 664 350 | 1354 351 | 678 352 | 500 353 | 3945 354 | 1355 355 | 3212 356 | 2443 357 | 416 358 | 3919 359 | 4041 360 | 1061 361 | 1545 362 | 1267 363 | 260 364 | 2921 365 | 2674 366 | 799 367 | 1261 368 | 1624 369 | 645 370 | 3566 371 | 1062 372 | 1215 373 | 2639 374 | 3270 375 | 3980 376 | 2678 377 | 3929 378 | 3685 379 | 476 380 | 3324 381 | 3373 382 | 2402 383 | 1957 384 | 604 385 | 2305 386 | 72 387 | 609 388 | 1306 389 | 525 390 | 2918 391 | 480 392 | 4021 393 | 1707 394 | 2022 395 | 720 396 | 3370 397 | 340 398 | 3145 399 | 1980 400 | 3278 401 | 3184 402 | 603 403 | 2784 404 | 212 405 | 4054 406 | 969 407 | 905 408 | 2892 409 | 2717 410 | 2551 411 | 94 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-4.txt: -------------------------------------------------------------------------------- 1 | 584 2 | 3018 3 | 2595 4 | 2738 5 | 619 6 | 1239 7 | 1083 8 | 2454 9 | 1518 10 | 3917 11 | 166 12 | 1487 13 | 1621 14 | 1745 15 | 1636 16 | 3113 17 | 2206 18 | 1591 19 | 1729 20 | 3843 21 | 1147 22 | 2975 23 | 4098 24 | 1427 25 | 1697 26 | 2056 27 | 3750 28 | 3499 29 | 307 30 | 365 31 | 3078 32 | 3229 33 | 812 34 | 3515 35 | 1759 36 | 1305 37 | 2760 38 | 205 39 | 3564 40 | 3472 41 | 832 42 | 3488 43 | 636 44 | 3528 45 | 3248 46 | 2478 47 | 1413 48 | 2074 49 | 2543 50 | 1088 51 | 1472 52 | 774 53 | 2103 54 | 2745 55 | 499 56 | 3050 57 | 2797 58 | 3234 59 | 3972 60 | 2849 61 | 2396 62 | 482 63 | 3899 64 | 3338 65 | 1152 66 | 1720 67 | 2597 68 | 2140 69 | 2621 70 | 3850 71 | 2113 72 | 814 73 | 775 74 | 3119 75 | 685 76 | 895 77 | 545 78 | 3231 79 | 4088 80 | 2324 81 | 2421 82 | 3619 83 | 524 84 | 3754 85 | 370 86 | 1025 87 | 742 88 | 1742 89 | 958 90 | 2436 91 | 2732 92 | 3821 93 | 671 94 | 1405 95 | 3721 96 | 897 97 | 1767 98 | 3994 99 | 646 100 | 891 101 | 435 102 | 3100 103 | 2239 104 | 2419 105 | 1037 106 | 1378 107 | 1521 108 | 3963 109 | 1809 110 | 3930 111 | 1324 112 | 3235 113 | 2248 114 | 3068 115 | 3724 116 | 35 117 | 3500 118 | 583 119 | 497 120 | 3244 121 | 3540 122 | 2222 123 | 2516 124 | 328 125 | 3759 126 | 3595 127 | 433 128 | 3206 129 | 2411 130 | 3776 131 | 1935 132 | 2645 133 | 2474 134 | 2777 135 | 1849 136 | 2668 137 | 3927 138 | 796 139 | 691 140 | 4080 141 | 573 142 | 1537 143 | 1030 144 | 944 145 | 151 146 | 444 147 | 3511 148 | 2183 149 | 999 150 | 107 151 | 2913 152 | 3133 153 | 682 154 | 3230 155 | 3741 156 | 3334 157 | 592 158 | 2180 159 | 829 160 | 2069 161 | 2004 162 | 3784 163 | 2042 164 | 1262 165 | 58 166 | 2049 167 | 3204 168 | 3503 169 | 355 170 | 1376 171 | 3828 172 | 3232 173 | 2536 174 | 2924 175 | 511 176 | 3964 177 | 2119 178 | 1363 179 | 3258 180 | 2606 181 | 1873 182 | 1041 183 | 396 184 | 3495 185 | 3004 186 | 1679 187 | 3123 188 | 384 189 | 4028 190 | 3003 191 | 3730 192 | 2917 193 | 281 194 | 3824 195 | 519 196 | 4092 197 | 3292 198 | 1153 199 | 2277 200 | 28 201 | 757 202 | 753 203 | 3191 204 | 1719 205 | 322 206 | 919 207 | 3320 208 | 2156 209 | 1725 210 | 2380 211 | 2632 212 | 2705 213 | 2553 214 | 1464 215 | 1098 216 | 4047 217 | 400 218 | 661 219 | 1711 220 | 667 221 | 314 222 | 439 223 | 459 224 | 3875 225 | 3449 226 | 1476 227 | 2509 228 | 2631 229 | 2973 230 | 2446 231 | 527 232 | 643 233 | 779 234 | 1663 235 | 3433 236 | 740 237 | 3690 238 | 2184 239 | 3984 240 | 441 241 | 1474 242 | 3943 243 | 105 244 | 2372 245 | 1855 246 | 2086 247 | 3944 248 | 1626 249 | 1672 250 | 2955 251 | 3213 252 | 743 253 | 1800 254 | 7 255 | 462 256 | 787 257 | 3295 258 | 1206 259 | 696 260 | 1867 261 | 2972 262 | 3942 263 | 534 264 | 1346 265 | 1052 266 | 2009 267 | 2452 268 | 2229 269 | 1816 270 | 721 271 | 1690 272 | 1469 273 | 2850 274 | 2170 275 | 3363 276 | 1157 277 | 2567 278 | 2838 279 | 1178 280 | 1961 281 | 76 282 | 1001 283 | 994 284 | 2572 285 | 3956 286 | 3327 287 | 3224 288 | 1885 289 | 802 290 | 3189 291 | 1758 292 | 2235 293 | 3865 294 | 228 295 | 3989 296 | 3496 297 | 2991 298 | 1513 299 | 1483 300 | 2425 301 | 3012 302 | 1964 303 | 1005 304 | 156 305 | 3329 306 | 3898 307 | 2604 308 | 4039 309 | 4052 310 | 1038 311 | 1066 312 | 1890 313 | 1137 314 | 1293 315 | 568 316 | 251 317 | 305 318 | 493 319 | 2577 320 | 193 321 | 2812 322 | 3517 323 | 795 324 | 3020 325 | 1115 326 | 2765 327 | 2072 328 | 657 329 | 2862 330 | 1580 331 | 2685 332 | 14 333 | 3057 334 | 1864 335 | 2730 336 | 3453 337 | 0 338 | 955 339 | 2694 340 | 2578 341 | 2449 342 | 1986 343 | 927 344 | 1693 345 | 3884 346 | 947 347 | 939 348 | 754 349 | 149 350 | 733 351 | 2207 352 | 3508 353 | 337 354 | 3178 355 | 2796 356 | 831 357 | 3140 358 | 3185 359 | 1393 360 | 3246 361 | 2821 362 | 3460 363 | 2787 364 | 3396 365 | 1428 366 | 3752 367 | 3060 368 | 3859 369 | 1299 370 | 3407 371 | 1998 372 | 1189 373 | 1646 374 | 81 375 | 1149 376 | 1129 377 | 1517 378 | 1197 379 | 709 380 | 1237 381 | 3667 382 | 1071 383 | 312 384 | 1454 385 | 171 386 | 535 387 | 2809 388 | 2782 389 | 1156 390 | 3346 391 | 3834 392 | 2428 393 | 2997 394 | 357 395 | 2300 396 | 2296 397 | 864 398 | 998 399 | 1874 400 | 3591 401 | 1902 402 | 3583 403 | 3120 404 | 2966 405 | 3951 406 | 3947 407 | 2907 408 | 3209 409 | 2044 410 | 1642 411 | 2958 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-8.txt: -------------------------------------------------------------------------------- 1 | 178 2 | 3696 3 | 4090 4 | 2157 5 | 1818 6 | 3458 7 | 1988 8 | 1478 9 | 3252 10 | 343 11 | 1981 12 | 2691 13 | 3179 14 | 3996 15 | 424 16 | 572 17 | 3849 18 | 3905 19 | 50 20 | 2580 21 | 276 22 | 1277 23 | 1337 24 | 1637 25 | 2328 26 | 1300 27 | 868 28 | 2714 29 | 1623 30 | 2992 31 | 2017 32 | 2761 33 | 2321 34 | 86 35 | 1736 36 | 1232 37 | 2279 38 | 3678 39 | 713 40 | 2356 41 | 953 42 | 2893 43 | 66 44 | 966 45 | 3632 46 | 1128 47 | 2909 48 | 3748 49 | 3474 50 | 1029 51 | 4096 52 | 2325 53 | 3410 54 | 2635 55 | 1692 56 | 1208 57 | 2938 58 | 1823 59 | 4058 60 | 1903 61 | 1652 62 | 722 63 | 2293 64 | 1480 65 | 1975 66 | 901 67 | 1335 68 | 3080 69 | 589 70 | 3542 71 | 390 72 | 2204 73 | 3086 74 | 2159 75 | 3961 76 | 3419 77 | 1741 78 | 934 79 | 2060 80 | 1169 81 | 273 82 | 3669 83 | 2722 84 | 1503 85 | 910 86 | 878 87 | 2978 88 | 3255 89 | 2719 90 | 571 91 | 872 92 | 1353 93 | 3392 94 | 3380 95 | 1423 96 | 4053 97 | 1895 98 | 2475 99 | 937 100 | 1145 101 | 2922 102 | 201 103 | 3102 104 | 1743 105 | 3402 106 | 2899 107 | 1000 108 | 4012 109 | 3417 110 | 1966 111 | 1034 112 | 2330 113 | 2506 114 | 3379 115 | 3815 116 | 2308 117 | 973 118 | 1734 119 | 3869 120 | 2122 121 | 1485 122 | 1587 123 | 2130 124 | 3680 125 | 3974 126 | 3757 127 | 1356 128 | 3987 129 | 3572 130 | 109 131 | 2200 132 | 1701 133 | 25 134 | 1615 135 | 1199 136 | 2961 137 | 2520 138 | 1059 139 | 3858 140 | 3288 141 | 1538 142 | 1468 143 | 225 144 | 143 145 | 249 146 | 1814 147 | 3743 148 | 2334 149 | 2994 150 | 3983 151 | 844 152 | 2412 153 | 3245 154 | 3552 155 | 1210 156 | 3626 157 | 509 158 | 2988 159 | 2335 160 | 3464 161 | 2263 162 | 3883 163 | 2326 164 | 951 165 | 1790 166 | 2451 167 | 1737 168 | 3 169 | 344 170 | 102 171 | 665 172 | 1941 173 | 3936 174 | 1540 175 | 3700 176 | 2530 177 | 2095 178 | 3827 179 | 2 180 | 3922 181 | 1953 182 | 2149 183 | 3171 184 | 2771 185 | 3176 186 | 1565 187 | 1602 188 | 1228 189 | 1013 190 | 332 191 | 1193 192 | 3181 193 | 492 194 | 3330 195 | 2755 196 | 374 197 | 2701 198 | 719 199 | 1385 200 | 167 201 | 1891 202 | 2219 203 | 1858 204 | 368 205 | 3124 206 | 3623 207 | 3273 208 | 2151 209 | 18 210 | 1671 211 | 2967 212 | 2527 213 | 3699 214 | 487 215 | 2783 216 | 460 217 | 1573 218 | 1015 219 | 529 220 | 2618 221 | 964 222 | 1824 223 | 2398 224 | 1717 225 | 1440 226 | 454 227 | 1543 228 | 288 229 | 923 230 | 1670 231 | 2886 232 | 4105 233 | 2354 234 | 941 235 | 2940 236 | 2948 237 | 3775 238 | 3825 239 | 2603 240 | 3486 241 | 1266 242 | 649 243 | 836 244 | 3253 245 | 3077 246 | 3860 247 | 3910 248 | 1659 249 | 3924 250 | 2740 251 | 738 252 | 2441 253 | 4109 254 | 1976 255 | 2158 256 | 590 257 | 57 258 | 2916 259 | 1853 260 | 1235 261 | 801 262 | 2654 263 | 2168 264 | 3169 265 | 404 266 | 2395 267 | 3739 268 | 1108 269 | 2673 270 | 668 271 | 1661 272 | 631 273 | 2373 274 | 2885 275 | 3394 276 | 51 277 | 1673 278 | 2360 279 | 1349 280 | 2223 281 | 2579 282 | 1959 283 | 71 284 | 49 285 | 1395 286 | 1133 287 | 1194 288 | 1927 289 | 484 290 | 53 291 | 2888 292 | 4072 293 | 3367 294 | 3272 295 | 1510 296 | 2555 297 | 824 298 | 3467 299 | 1731 300 | 2952 301 | 2575 302 | 1554 303 | 1084 304 | 3413 305 | 3281 306 | 1931 307 | 1265 308 | 1938 309 | 1330 310 | 1765 311 | 1390 312 | 2062 313 | 334 314 | 747 315 | 2462 316 | 1323 317 | 3159 318 | 3029 319 | 611 320 | 2221 321 | 3079 322 | 4063 323 | 2734 324 | 1326 325 | 2750 326 | 2453 327 | 2365 328 | 2025 329 | 606 330 | 2911 331 | 2391 332 | 145 333 | 938 334 | 915 335 | 1404 336 | 1861 337 | 2203 338 | 3914 339 | 2461 340 | 2471 341 | 1675 342 | 3695 343 | 3146 344 | 3317 345 | 2477 346 | 3157 347 | 789 348 | 2686 349 | 1076 350 | 838 351 | 2629 352 | 3383 353 | 3529 354 | 2026 355 | 2386 356 | 4031 357 | 268 358 | 1333 359 | 1514 360 | 634 361 | 467 362 | 1255 363 | 2061 364 | 3629 365 | 912 366 | 2234 367 | 2261 368 | 2040 369 | 1991 370 | 1561 371 | 2385 372 | 2006 373 | 761 374 | 235 375 | 885 376 | 3751 377 | 347 378 | 1054 379 | 3254 380 | 3604 381 | 1082 382 | 2000 383 | 3664 384 | 2919 385 | 1445 386 | 896 387 | 1455 388 | 478 389 | 3665 390 | 1648 391 | 758 392 | 2657 393 | 163 394 | 3760 395 | 2976 396 | 767 397 | 714 398 | 461 399 | 2930 400 | 1365 401 | 1568 402 | 2291 403 | 2636 404 | 3412 405 | 3786 406 | 3725 407 | 2253 408 | 2185 409 | 4005 410 | 2445 411 | 3995 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-9.txt: -------------------------------------------------------------------------------- 1 | 2241 2 | 1847 3 | 2808 4 | 1896 5 | 3473 6 | 217 7 | 2957 8 | 3103 9 | 724 10 | 1908 11 | 2565 12 | 1459 13 | 2545 14 | 3384 15 | 3613 16 | 1032 17 | 1442 18 | 825 19 | 144 20 | 3353 21 | 2781 22 | 3507 23 | 578 24 | 42 25 | 842 26 | 2901 27 | 2614 28 | 115 29 | 2751 30 | 1131 31 | 1177 32 | 366 33 | 2591 34 | 2920 35 | 2486 36 | 2361 37 | 3174 38 | 569 39 | 2401 40 | 1987 41 | 1294 42 | 660 43 | 1960 44 | 1845 45 | 1583 46 | 1689 47 | 1974 48 | 2320 49 | 1371 50 | 3841 51 | 3969 52 | 784 53 | 2357 54 | 530 55 | 847 56 | 880 57 | 1773 58 | 1362 59 | 1264 60 | 2526 61 | 128 62 | 985 63 | 2193 64 | 1916 65 | 759 66 | 975 67 | 3182 68 | 3876 69 | 3643 70 | 3728 71 | 3649 72 | 1667 73 | 3597 74 | 3135 75 | 158 76 | 3814 77 | 2483 78 | 2019 79 | 1475 80 | 4048 81 | 1289 82 | 2084 83 | 220 84 | 2653 85 | 770 86 | 2914 87 | 3039 88 | 3912 89 | 1188 90 | 598 91 | 1236 92 | 2287 93 | 687 94 | 1491 95 | 3044 96 | 160 97 | 3761 98 | 3074 99 | 821 100 | 1840 101 | 4104 102 | 2383 103 | 2487 104 | 1609 105 | 1106 106 | 474 107 | 900 108 | 839 109 | 173 110 | 3637 111 | 2569 112 | 763 113 | 3243 114 | 876 115 | 3569 116 | 2143 117 | 2923 118 | 2024 119 | 2154 120 | 3221 121 | 976 122 | 2379 123 | 3867 124 | 377 125 | 3835 126 | 1200 127 | 238 128 | 1444 129 | 3764 130 | 324 131 | 3941 132 | 1570 133 | 3939 134 | 2642 135 | 449 136 | 336 137 | 3398 138 | 3826 139 | 3873 140 | 1446 141 | 2890 142 | 2568 143 | 168 144 | 2592 145 | 982 146 | 1872 147 | 2993 148 | 867 149 | 4066 150 | 1154 151 | 1174 152 | 3397 153 | 2007 154 | 2121 155 | 1640 156 | 1912 157 | 3389 158 | 3385 159 | 843 160 | 1668 161 | 4051 162 | 3648 163 | 2077 164 | 3186 165 | 2725 166 | 3781 167 | 3746 168 | 2588 169 | 3150 170 | 3493 171 | 907 172 | 1821 173 | 2666 174 | 3726 175 | 2161 176 | 865 177 | 1566 178 | 38 179 | 3024 180 | 1112 181 | 3175 182 | 2482 183 | 2752 184 | 3896 185 | 2105 186 | 835 187 | 130 188 | 211 189 | 854 190 | 327 191 | 1135 192 | 756 193 | 2562 194 | 2447 195 | 1462 196 | 248 197 | 1290 198 | 2507 199 | 3952 200 | 393 201 | 605 202 | 683 203 | 1827 204 | 3097 205 | 562 206 | 278 207 | 1509 208 | 837 209 | 1943 210 | 3614 211 | 3451 212 | 826 213 | 1782 214 | 3838 215 | 579 216 | 1954 217 | 2887 218 | 577 219 | 83 220 | 2902 221 | 361 222 | 1542 223 | 2212 224 | 246 225 | 2925 226 | 2557 227 | 2928 228 | 250 229 | 274 230 | 3756 231 | 2795 232 | 2662 233 | 2677 234 | 2230 235 | 2355 236 | 3325 237 | 376 238 | 1303 239 | 114 240 | 863 241 | 3406 242 | 2124 243 | 2329 244 | 1184 245 | 2127 246 | 700 247 | 2931 248 | 2030 249 | 2286 250 | 3518 251 | 3466 252 | 2731 253 | 1167 254 | 2341 255 | 2460 256 | 3462 257 | 3041 258 | 1368 259 | 1113 260 | 3708 261 | 2655 262 | 2640 263 | 1308 264 | 3107 265 | 3289 266 | 1751 267 | 3661 268 | 3677 269 | 2091 270 | 1063 271 | 3925 272 | 2665 273 | 803 274 | 3565 275 | 3072 276 | 3797 277 | 3223 278 | 233 279 | 3718 280 | 588 281 | 3089 282 | 27 283 | 2141 284 | 776 285 | 1343 286 | 2623 287 | 2715 288 | 1074 289 | 3816 290 | 3236 291 | 37 292 | 187 293 | 2700 294 | 1119 295 | 1325 296 | 2458 297 | 2029 298 | 4064 299 | 1321 300 | 1240 301 | 1811 302 | 3055 303 | 2872 304 | 387 305 | 3887 306 | 1311 307 | 2333 308 | 948 309 | 2323 310 | 477 311 | 2087 312 | 3620 313 | 2817 314 | 2658 315 | 3727 316 | 3371 317 | 1296 318 | 1429 319 | 2164 320 | 131 321 | 1417 322 | 200 323 | 3013 324 | 1205 325 | 330 326 | 3497 327 | 3058 328 | 261 329 | 1539 330 | 125 331 | 3388 332 | 1968 333 | 2549 334 | 674 335 | 2912 336 | 3539 337 | 447 338 | 219 339 | 1310 340 | 2338 341 | 3162 342 | 2596 343 | 2929 344 | 1457 345 | 2622 346 | 1772 347 | 3820 348 | 1595 349 | 3710 350 | 36 351 | 3692 352 | 642 353 | 512 354 | 2933 355 | 3065 356 | 1257 357 | 2644 358 | 1771 359 | 2167 360 | 1225 361 | 2012 362 | 1993 363 | 886 364 | 392 365 | 2196 366 | 1969 367 | 2788 368 | 3027 369 | 1666 370 | 1146 371 | 3401 372 | 3514 373 | 3810 374 | 3713 375 | 1781 376 | 1081 377 | 3400 378 | 597 379 | 95 380 | 2633 381 | 1680 382 | 3478 383 | 4032 384 | 2399 385 | 929 386 | 1499 387 | 3297 388 | 1160 389 | 1807 390 | 946 391 | 961 392 | 1281 393 | 1313 394 | 2977 395 | 3693 396 | 3022 397 | 2793 398 | 65 399 | 1738 400 | 2181 401 | 962 402 | 781 403 | 2744 404 | 3999 405 | 1309 406 | 3697 407 | 2748 408 | 1806 409 | 3280 410 | 1766 411 | 1555 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-1.txt: -------------------------------------------------------------------------------- 1 | 2585 2 | 3444 3 | 1247 4 | 3872 5 | 63 6 | 155 7 | 3770 8 | 257 9 | 1439 10 | 247 11 | 3716 12 | 1103 13 | 2082 14 | 615 15 | 1970 16 | 2246 17 | 2231 18 | 607 19 | 453 20 | 1051 21 | 1386 22 | 1582 23 | 3986 24 | 3774 25 | 1801 26 | 3829 27 | 1710 28 | 1930 29 | 1436 30 | 1596 31 | 3723 32 | 3979 33 | 1058 34 | 633 35 | 96 36 | 1685 37 | 772 38 | 3839 39 | 3747 40 | 1511 41 | 1479 42 | 3010 43 | 3777 44 | 893 45 | 4043 46 | 1939 47 | 4084 48 | 3141 49 | 192 50 | 1493 51 | 1497 52 | 3817 53 | 3682 54 | 1284 55 | 3156 56 | 3548 57 | 1718 58 | 4073 59 | 560 60 | 3337 61 | 2656 62 | 2721 63 | 2081 64 | 1456 65 | 1995 66 | 3967 67 | 2489 68 | 3953 69 | 1243 70 | 2209 71 | 2664 72 | 737 73 | 3848 74 | 3143 75 | 3302 76 | 202 77 | 4087 78 | 622 79 | 3506 80 | 1665 81 | 4002 82 | 3981 83 | 1972 84 | 3115 85 | 1682 86 | 822 87 | 2465 88 | 350 89 | 4045 90 | 4029 91 | 2367 92 | 1889 93 | 4042 94 | 3973 95 | 176 96 | 2870 97 | 950 98 | 2593 99 | 1951 100 | 602 101 | 849 102 | 2224 103 | 2349 104 | 3007 105 | 4038 106 | 637 107 | 681 108 | 576 109 | 1650 110 | 1556 111 | 1547 112 | 2775 113 | 1727 114 | 2776 115 | 3239 116 | 2090 117 | 2785 118 | 1841 119 | 1276 120 | 2512 121 | 74 122 | 531 123 | 3084 124 | 1536 125 | 3436 126 | 448 127 | 1272 128 | 3608 129 | 2299 130 | 3195 131 | 135 132 | 3991 133 | 965 134 | 40 135 | 1358 136 | 1694 137 | 3489 138 | 766 139 | 473 140 | 3711 141 | 2716 142 | 1730 143 | 3205 144 | 4074 145 | 3399 146 | 325 147 | 203 148 | 2417 149 | 1837 150 | 165 151 | 190 152 | 264 153 | 2846 154 | 1027 155 | 1936 156 | 3634 157 | 4106 158 | 2112 159 | 3227 160 | 2410 161 | 3477 162 | 1716 163 | 3701 164 | 2076 165 | 1757 166 | 1089 167 | 1164 168 | 469 169 | 2010 170 | 3742 171 | 2250 172 | 3731 173 | 1904 174 | 3805 175 | 2039 176 | 856 177 | 3546 178 | 3387 179 | 3415 180 | 3482 181 | 2257 182 | 2295 183 | 3265 184 | 2883 185 | 3831 186 | 1271 187 | 995 188 | 638 189 | 942 190 | 1532 191 | 2528 192 | 1813 193 | 2753 194 | 1400 195 | 4008 196 | 3785 197 | 90 198 | 2058 199 | 617 200 | 505 201 | 2826 202 | 1329 203 | 2680 204 | 3393 205 | 3918 206 | 2814 207 | 4011 208 | 2294 209 | 2135 210 | 3441 211 | 2358 212 | 208 213 | 3322 214 | 3955 215 | 992 216 | 2015 217 | 1053 218 | 3657 219 | 3854 220 | 2473 221 | 626 222 | 2583 223 | 17 224 | 463 225 | 1630 226 | 2703 227 | 3085 228 | 3926 229 | 1695 230 | 3587 231 | 1833 232 | 3668 233 | 2173 234 | 2254 235 | 1686 236 | 1424 237 | 627 238 | 2439 239 | 3262 240 | 298 241 | 1201 242 | 2837 243 | 3298 244 | 3042 245 | 33 246 | 675 247 | 2552 248 | 601 249 | 3306 250 | 1907 251 | 2258 252 | 2628 253 | 1292 254 | 1732 255 | 3483 256 | 3215 257 | 2171 258 | 450 259 | 1286 260 | 2432 261 | 2198 262 | 267 263 | 2615 264 | 3702 265 | 2616 266 | 1920 267 | 1569 268 | 3076 269 | 786 270 | 1227 271 | 271 272 | 2843 273 | 245 274 | 1090 275 | 2819 276 | 2625 277 | 3960 278 | 2322 279 | 1361 280 | 2690 281 | 2347 282 | 1774 283 | 3323 284 | 1797 285 | 2648 286 | 1320 287 | 2111 288 | 1028 289 | 111 290 | 3051 291 | 3666 292 | 618 293 | 2810 294 | 2829 295 | 815 296 | 996 297 | 359 298 | 2676 299 | 3470 300 | 1585 301 | 697 302 | 2109 303 | 174 304 | 3868 305 | 2343 306 | 3988 307 | 990 308 | 526 309 | 4015 310 | 2211 311 | 4000 312 | 1862 313 | 676 314 | 874 315 | 639 316 | 2652 317 | 3799 318 | 887 319 | 185 320 | 3438 321 | 2459 322 | 4017 323 | 906 324 | 2679 325 | 466 326 | 2352 327 | 1588 328 | 2424 329 | 3913 330 | 2612 331 | 88 332 | 3959 333 | 3846 334 | 117 335 | 2020 336 | 1008 337 | 4095 338 | 1105 339 | 2346 340 | 2695 341 | 3579 342 | 2348 343 | 1382 344 | 3081 345 | 3802 346 | 1452 347 | 1121 348 | 3893 349 | 2247 350 | 3813 351 | 2637 352 | 12 353 | 1850 354 | 382 355 | 2479 356 | 1251 357 | 1704 358 | 2895 359 | 2626 360 | 287 361 | 3187 362 | 333 363 | 2368 364 | 640 365 | 146 366 | 2197 367 | 978 368 | 2944 369 | 899 370 | 4023 371 | 564 372 | 3082 373 | 98 374 | 2663 375 | 3293 376 | 1458 377 | 533 378 | 1592 379 | 2448 380 | 2376 381 | 3037 382 | 2003 383 | 1826 384 | 1040 385 | 1506 386 | 1412 387 | 2661 388 | 820 389 | 1482 390 | 2950 391 | 2031 392 | 1234 393 | 3949 394 | 881 395 | 2123 396 | 353 397 | 1102 398 | 2389 399 | 1336 400 | 358 401 | 2099 402 | 4034 403 | 3909 404 | 4033 405 | 3214 406 | 2133 407 | 3047 408 | 2244 409 | 3121 410 | 491 411 | 4009 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-5.txt: -------------------------------------------------------------------------------- 1 | 739 2 | 548 3 | 3720 4 | 2707 5 | 2137 6 | 2068 7 | 1383 8 | 514 9 | 3763 10 | 2564 11 | 2790 12 | 403 13 | 1126 14 | 348 15 | 1278 16 | 2187 17 | 3656 18 | 1839 19 | 909 20 | 3715 21 | 229 22 | 612 23 | 1134 24 | 1965 25 | 2546 26 | 1780 27 | 277 28 | 517 29 | 3958 30 | 3633 31 | 3712 32 | 565 33 | 2959 34 | 3521 35 | 3578 36 | 1705 37 | 2456 38 | 148 39 | 406 40 | 1418 41 | 3812 42 | 594 43 | 3679 44 | 2964 45 | 925 46 | 1557 47 | 2266 48 | 237 49 | 2132 50 | 1018 51 | 3061 52 | 736 53 | 3886 54 | 1399 55 | 402 56 | 3706 57 | 3971 58 | 558 59 | 993 60 | 3650 61 | 3316 62 | 488 63 | 1922 64 | 4077 65 | 3344 66 | 1843 67 | 1815 68 | 2317 69 | 3094 70 | 2202 71 | 1501 72 | 1645 73 | 1915 74 | 1017 75 | 3285 76 | 2233 77 | 3844 78 | 3738 79 | 3276 80 | 172 81 | 960 82 | 790 83 | 3144 84 | 3698 85 | 2867 86 | 1463 87 | 3577 88 | 3405 89 | 280 90 | 974 91 | 2297 92 | 3541 93 | 3033 94 | 2094 95 | 1116 96 | 813 97 | 1085 98 | 1380 99 | 2681 100 | 379 101 | 2842 102 | 3554 103 | 3492 104 | 2571 105 | 3705 106 | 3622 107 | 2756 108 | 2979 109 | 3882 110 | 375 111 | 489 112 | 2915 113 | 486 114 | 2495 115 | 3161 116 | 1990 117 | 684 118 | 464 119 | 1796 120 | 556 121 | 289 122 | 2208 123 | 4107 124 | 1795 125 | 712 126 | 2650 127 | 2712 128 | 3567 129 | 3001 130 | 523 131 | 383 132 | 1233 133 | 913 134 | 3921 135 | 1703 136 | 197 137 | 3889 138 | 2556 139 | 2378 140 | 316 141 | 16 142 | 1918 143 | 804 144 | 1789 145 | 80 146 | 2285 147 | 3111 148 | 4101 149 | 258 150 | 3617 151 | 3687 152 | 3349 153 | 1786 154 | 771 155 | 3437 156 | 1880 157 | 2409 158 | 3226 159 | 1613 160 | 1086 161 | 3625 162 | 1165 163 | 986 164 | 2136 165 | 2033 166 | 1836 167 | 3596 168 | 3681 169 | 2014 170 | 4026 171 | 1100 172 | 1195 173 | 286 174 | 2697 175 | 2514 176 | 1526 177 | 1467 178 | 3911 179 | 1046 180 | 3199 181 | 1618 182 | 4070 183 | 1432 184 | 1869 185 | 1866 186 | 1706 187 | 1754 188 | 1130 189 | 432 190 | 2689 191 | 888 192 | 3242 193 | 1956 194 | 2539 195 | 2407 196 | 3505 197 | 2046 198 | 1633 199 | 104 200 | 702 201 | 3902 202 | 3130 203 | 2005 204 | 378 205 | 3002 206 | 1047 207 | 1339 208 | 255 209 | 1508 210 | 2256 211 | 1398 212 | 2498 213 | 715 214 | 1925 215 | 240 216 | 1014 217 | 3463 218 | 1073 219 | 1876 220 | 2276 221 | 2882 222 | 3598 223 | 3198 224 | 3571 225 | 3555 226 | 1614 227 | 3585 228 | 2742 229 | 1406 230 | 2736 231 | 2974 232 | 954 233 | 346 234 | 84 235 | 1835 236 | 2630 237 | 3358 238 | 2773 239 | 1159 240 | 1246 241 | 3543 242 | 2126 243 | 3970 244 | 554 245 | 227 246 | 3300 247 | 2825 248 | 3581 249 | 3194 250 | 262 251 | 1653 252 | 154 253 | 3062 254 | 2238 255 | 2036 256 | 1559 257 | 3136 258 | 3291 259 | 741 260 | 470 261 | 139 262 | 1541 263 | 34 264 | 3851 265 | 47 266 | 3671 267 | 2057 268 | 1304 269 | 2937 270 | 2799 271 | 1574 272 | 4071 273 | 3532 274 | 984 275 | 2283 276 | 3837 277 | 2192 278 | 2155 279 | 1755 280 | 3923 281 | 877 282 | 1597 283 | 666 284 | 2970 285 | 2839 286 | 1572 287 | 3630 288 | 1528 289 | 3894 290 | 2066 291 | 1529 292 | 4027 293 | 1923 294 | 3375 295 | 2340 296 | 2804 297 | 1798 298 | 1004 299 | 780 300 | 520 301 | 788 302 | 3791 303 | 1450 304 | 457 305 | 1756 306 | 1605 307 | 1726 308 | 3369 309 | 2675 310 | 2075 311 | 3421 312 | 3535 313 | 1466 314 | 3582 315 | 2576 316 | 3573 317 | 3879 318 | 873 319 | 2146 320 | 1601 321 | 1678 322 | 1584 323 | 67 324 | 4025 325 | 1619 326 | 2078 327 | 1662 328 | 1488 329 | 2098 330 | 2278 331 | 302 332 | 1863 333 | 1318 334 | 2096 335 | 1002 336 | 1370 337 | 623 338 | 184 339 | 689 340 | 3794 341 | 1213 342 | 1842 343 | 3158 344 | 1878 345 | 2541 346 | 2303 347 | 4091 348 | 3819 349 | 3356 350 | 1342 351 | 224 352 | 2847 353 | 1535 354 | 22 355 | 3938 356 | 3662 357 | 3673 358 | 3049 359 | 147 360 | 2468 361 | 1660 362 | 2128 363 | 2100 364 | 1698 365 | 1641 366 | 2962 367 | 711 368 | 2968 369 | 3533 370 | 3985 371 | 2079 372 | 933 373 | 3780 374 | 1218 375 | 3139 376 | 658 377 | 391 378 | 364 379 | 1644 380 | 2981 381 | 3476 382 | 2728 383 | 3266 384 | 2800 385 | 2996 386 | 3790 387 | 1263 388 | 2189 389 | 2971 390 | 1655 391 | 1161 392 | 230 393 | 1932 394 | 3332 395 | 373 396 | 4089 397 | 1848 398 | 456 399 | 1905 400 | 189 401 | 3341 402 | 1620 403 | 3152 404 | 608 405 | 2083 406 | 3439 407 | 3378 408 | 834 409 | 2903 410 | 3655 411 | 3264 412 | -------------------------------------------------------------------------------- /dataset/fold-idx/NCI1/test_idx-6.txt: -------------------------------------------------------------------------------- 1 | 2815 2 | 2942 3 | 943 4 | 2071 5 | 2106 6 | 335 7 | 2823 8 | 1465 9 | 3704 10 | 2953 11 | 3635 12 | 2182 13 | 1347 14 | 732 15 | 3487 16 | 116 17 | 3435 18 | 3475 19 | 1207 20 | 297 21 | 3309 22 | 445 23 | 1714 24 | 2706 25 | 1860 26 | 2822 27 | 2406 28 | 1270 29 | 4065 30 | 1389 31 | 388 32 | 3782 33 | 4014 34 | 563 35 | 1892 36 | 1219 37 | 2699 38 | 1080 39 | 690 40 | 2586 41 | 3857 42 | 2638 43 | 498 44 | 1875 45 | 2505 46 | 2214 47 | 440 48 | 1024 49 | 1298 50 | 2510 51 | 1312 52 | 1926 53 | 3282 54 | 2301 55 | 924 56 | 134 57 | 3878 58 | 1079 59 | 792 60 | 1949 61 | 3132 62 | 3009 63 | 3360 64 | 4006 65 | 3801 66 | 2178 67 | 3098 68 | 2845 69 | 2217 70 | 764 71 | 437 72 | 1552 73 | 3796 74 | 3043 75 | 326 76 | 1531 77 | 2172 78 | 1594 79 | 547 80 | 3611 81 | 593 82 | 574 83 | 3908 84 | 252 85 | 2186 86 | 1563 87 | 2905 88 | 3333 89 | 1603 90 | 68 91 | 3900 92 | 1010 93 | 2051 94 | 1894 95 | 2165 96 | 153 97 | 1504 98 | 2540 99 | 3025 100 | 1546 101 | 177 102 | 1223 103 | 136 104 | 1334 105 | 3142 106 | 2188 107 | 2670 108 | 2001 109 | 1820 110 | 2306 111 | 354 112 | 2503 113 | 3192 114 | 4056 115 | 1612 116 | 1176 117 | 2427 118 | 3138 119 | 931 120 | 630 121 | 1778 122 | 1373 123 | 2634 124 | 911 125 | 2050 126 | 2671 127 | 2093 128 | 1415 129 | 1460 130 | 875 131 | 869 132 | 1819 133 | 550 134 | 3755 135 | 422 136 | 1181 137 | 2273 138 | 2820 139 | 1260 140 | 1447 141 | 871 142 | 3877 143 | 2065 144 | 2599 145 | 2873 146 | 2693 147 | 2345 148 | 413 149 | 3183 150 | 3149 151 | 1173 152 | 1764 153 | 3749 154 | 959 155 | 266 156 | 3502 157 | 2403 158 | 670 159 | 1182 160 | 1229 161 | 2364 162 | 140 163 | 793 164 | 4057 165 | 3534 166 | 2307 167 | 3793 168 | 2053 169 | 4108 170 | 1934 171 | 2290 172 | 2264 173 | 3225 174 | 1702 175 | 2169 176 | 4078 177 | 1852 178 | 3616 179 | 2116 180 | 3560 181 | 3014 182 | 3615 183 | 2619 184 | 2802 185 | 1683 186 | 3993 187 | 1793 188 | 1114 189 | 1123 190 | 1250 191 | 2059 192 | 2726 193 | 1776 194 | 3789 195 | 1092 196 | 438 197 | 3170 198 | 99 199 | 3073 200 | 2145 201 | 4004 202 | 3347 203 | 124 204 | 723 205 | 303 206 | 356 207 | 3434 208 | 2611 209 | 2371 210 | 3431 211 | 1132 212 | 1026 213 | 2600 214 | 2853 215 | 694 216 | 112 217 | 3890 218 | 1879 219 | 3639 220 | 866 221 | 575 222 | 2566 223 | 232 224 | 2779 225 | 2672 226 | 2415 227 | 1921 228 | 213 229 | 215 230 | 15 231 | 1248 232 | 3590 233 | 904 234 | 2393 235 | 2227 236 | 3557 237 | 3446 238 | 4016 239 | 2683 240 | 236 241 | 3870 242 | 1319 243 | 1651 244 | 1387 245 | 309 246 | 2481 247 | 1674 248 | 2502 249 | 282 250 | 1067 251 | 852 252 | 2684 253 | 2801 254 | 162 255 | 1279 256 | 2467 257 | 930 258 | 591 259 | 3318 260 | 3654 261 | 2298 262 | 2243 263 | 3312 264 | 3644 265 | 2521 266 | 1295 267 | 2857 268 | 2191 269 | 1162 270 | 2608 271 | 1748 272 | 56 273 | 3471 274 | 1713 275 | 1050 276 | 93 277 | 1375 278 | 808 279 | 680 280 | 1608 281 | 1241 282 | 1622 283 | 542 284 | 2251 285 | 1031 286 | 1604 287 | 3940 288 | 1828 289 | 2327 290 | 1003 291 | 2228 292 | 3217 293 | 807 294 | 2038 295 | 1 296 | 3377 297 | 4050 298 | 2833 299 | 3965 300 | 2144 301 | 1733 302 | 818 303 | 3064 304 | 2190 305 | 3429 306 | 3005 307 | 2806 308 | 2746 309 | 3461 310 | 1245 311 | 3612 312 | 3530 313 | 321 314 | 2866 315 | 3091 316 | 2476 317 | 1350 318 | 1627 319 | 1502 320 | 2260 321 | 3000 322 | 1735 323 | 3787 324 | 586 325 | 2472 326 | 3348 327 | 399 328 | 1560 329 | 106 330 | 431 331 | 1898 332 | 3516 333 | 2166 334 | 1307 335 | 1897 336 | 3359 337 | 3425 338 | 805 339 | 3642 340 | 3354 341 | 207 342 | 1338 343 | 1794 344 | 3628 345 | 1101 346 | 3173 347 | 3840 348 | 1394 349 | 2794 350 | 3216 351 | 659 352 | 234 353 | 1967 354 | 3177 355 | 3228 356 | 3168 357 | 3683 358 | 3932 359 | 3803 360 | 3501 361 | 2490 362 | 2989 363 | 3481 364 | 3584 365 | 3031 366 | 3128 367 | 2344 368 | 3088 369 | 2558 370 | 2496 371 | 259 372 | 2669 373 | 1437 374 | 339 375 | 800 376 | 2807 377 | 3240 378 | 707 379 | 4003 380 | 1367 381 | 620 382 | 122 383 | 423 384 | 132 385 | 1947 386 | 2292 387 | 21 388 | 816 389 | 2910 390 | 2544 391 | 1332 392 | 1822 393 | 2289 394 | 3151 395 | 3430 396 | 3032 397 | 1470 398 | 3069 399 | 3853 400 | 1632 401 | 1753 402 | 206 403 | 673 404 | 2868 405 | 3624 406 | 2696 407 | 2055 408 | 1209 409 | 862 410 | 3016 411 | 1021 412 | -------------------------------------------------------------------------------- /gckn/gckn_fast/gckn_fast.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import torch 4 | from gckn.gckn_fast import gckn_fast_cpu 5 | if torch.cuda.is_available(): 6 | try: 7 | from gckn.gckn_fast import gckn_fast_cuda 8 | except: 9 | pass 10 | 11 | 12 | def path_conv_forward(path_indices, features): 13 | if features.is_cuda: 14 | output = gckn_fast_cuda.path_conv_forward(path_indices, features) 15 | else: 16 | output = gckn_fast_cpu.path_conv_forward(path_indices, features) 17 | return output 18 | 19 | def path_conv_backward(grad_input, grad_output, path_indices): 20 | if grad_output.is_cuda: 21 | gckn_fast_cuda.path_conv_backward(grad_input, grad_output, path_indices) 22 | else: 23 | gckn_fast_cpu.path_conv_backward(grad_input, grad_output, path_indices) 24 | 25 | class PathConv(torch.autograd.Function): 26 | @staticmethod 27 | def forward(ctx, path_indices, features): 28 | if features.is_cuda: 29 | output = gckn_fast_cuda.path_conv_forward(path_indices, features) 30 | else: 31 | output = gckn_fast_cpu.path_conv_forward(path_indices, features) 32 | ctx.save_for_backward(path_indices) 33 | ctx.size = features.size() 34 | return output 35 | 36 | @staticmethod 37 | def backward(ctx, grad_output): 38 | grad_input = grad_output.new_zeros(ctx.size) 39 | if grad_output.is_cuda: 40 | gckn_fast_cuda.path_conv_backward(grad_input, grad_output.contiguous(), *ctx.saved_variables) 41 | else: 42 | gckn_fast_cpu.path_conv_backward(grad_input, grad_output.contiguous(), *ctx.saved_variables) 43 | return None, grad_input 44 | 45 | def path_conv(path_indices, features): 46 | import torch.nn.functional as F 47 | output = F.embedding(path_indices, features.view(features.shape[0], -1)).view( 48 | path_indices.shape[0], path_indices.shape[1], features.shape[1], features.shape[2]) 49 | output = output.diagonal(dim1=1, dim2=2) 50 | # output: all_paths x path_size x path_size x hidden_size 51 | # -> all_paths x hidden_size x path_size 52 | output = output.mean(dim=-1) 53 | return output 54 | 55 | def test(cuda=False): 56 | torch.manual_seed(1234) 57 | 58 | path_size = 5 59 | n_nodes = 100 60 | hidden_size = 32 61 | n_paths = 100000 62 | x = torch.randn(n_nodes, path_size, hidden_size) 63 | path_indices = torch.randint(0, n_nodes, (n_paths, path_size)) 64 | 65 | if cuda: 66 | x = x.cuda() 67 | path_indices = path_indices.cuda() 68 | 69 | x.requires_grad_() 70 | print('start') 71 | out = PathConv.apply(path_indices, x) 72 | out1 = out.data 73 | out = out.mean() 74 | out.backward() 75 | grad1 = x.grad.data 76 | x.grad = None 77 | 78 | out = path_conv(path_indices, x) 79 | out2 = out.data 80 | out = out.mean() 81 | out.backward() 82 | grad2 = x.grad.data 83 | # print(out1) 84 | # print(out2) 85 | print(torch.max(torch.abs(out1 - out2))) 86 | print(torch.max(torch.abs(grad1 - grad2))) 87 | 88 | import time 89 | forward = 0 90 | backward = 0 91 | n_iter = 10 92 | for _ in range(n_iter): 93 | start = time.time() 94 | out = PathConv.apply(path_indices, x) 95 | if cuda: 96 | torch.cuda.synchronize() 97 | forward += time.time() - start 98 | 99 | out = out.mean() 100 | start = time.time() 101 | out.backward() 102 | if cuda: 103 | torch.cuda.synchronize() 104 | backward += time.time() - start 105 | 106 | print('Mine Forward: {:.3f} ms | Backward {:.3f} ms'.format(forward * 1e3/n_iter, backward * 1e3/n_iter)) 107 | 108 | import time 109 | forward = 0 110 | backward = 0 111 | n_iter = 10 112 | for _ in range(n_iter): 113 | start = time.time() 114 | out = path_conv(path_indices, x) 115 | if cuda: 116 | torch.cuda.synchronize() 117 | forward += time.time() - start 118 | 119 | out = out.mean() 120 | start = time.time() 121 | out.backward() 122 | if cuda: 123 | torch.cuda.synchronize() 124 | backward += time.time() - start 125 | 126 | print('Pytorch Forward: {:.3f} ms | Backward {:.3f} ms'.format(forward * 1e3/n_iter, backward * 1e3/n_iter)) 127 | 128 | 129 | if __name__ == "__main__": 130 | test(cuda=False) 131 | -------------------------------------------------------------------------------- /transformer/data.py: -------------------------------------------------------------------------------- 1 | # from torch.utils.data import Datasets 2 | import torch 3 | import torch.nn.functional as F 4 | from torch.utils.data.dataloader import default_collate 5 | import torch_geometric.utils as utils 6 | 7 | 8 | class GraphDataset(object): 9 | def __init__(self, dataset, n_tags=None, degree=False): 10 | """a pytorch geometric dataset as input 11 | """ 12 | self.dataset = dataset 13 | self.n_features = dataset[0].x.shape[-1] 14 | self.pe_list = None 15 | self.lap_pe_list = None 16 | self.degree_list = None 17 | if degree: 18 | self.compute_degree() 19 | self.n_tags = n_tags 20 | self.one_hot() 21 | 22 | def __len__(self): 23 | return len(self.dataset) 24 | 25 | def __getitem__(self, index): 26 | data = self.dataset[index] 27 | if self.x_onehot is not None and len(self.x_onehot) == len(self.dataset): 28 | data.x_onehot = self.x_onehot[index] 29 | if self.pe_list is not None and len(self.pe_list) == len(self.dataset): 30 | data.pe = self.pe_list[index] 31 | if self.lap_pe_list is not None and len(self.lap_pe_list) == len(self.dataset): 32 | data.lap_pe = self.lap_pe_list[index] 33 | if self.degree_list is not None and len(self.degree_list) == len(self.dataset): 34 | data.degree = self.degree_list[index] 35 | return data 36 | 37 | def compute_degree(self): 38 | self.degree_list = [] 39 | for g in self.dataset: 40 | deg = 1. / torch.sqrt(1. + utils.degree(g.edge_index[0], g.num_nodes)) 41 | self.degree_list.append(deg) 42 | 43 | def input_size(self): 44 | if self.n_tags is None: 45 | return self.n_features 46 | return self.n_tags 47 | 48 | def one_hot(self): 49 | self.x_onehot = None 50 | if self.n_tags is not None and self.n_tags > 1: 51 | self.x_onehot = [] 52 | for g in self.dataset: 53 | onehot = F.one_hot(g.x.view(-1).long(), self.n_tags) 54 | self.x_onehot.append(onehot) 55 | 56 | def collate_fn(self): 57 | def collate(batch): 58 | batch = list(batch) 59 | max_len = max(len(g.x) for g in batch) 60 | 61 | if self.n_tags is None: 62 | padded_x = torch.zeros((len(batch), max_len, self.n_features)) 63 | else: 64 | # discrete node attributes 65 | padded_x = torch.zeros((len(batch), max_len, self.n_tags)) 66 | mask = torch.zeros((len(batch), max_len), dtype=bool) 67 | labels = [] 68 | 69 | # TODO: check if position encoding matrix is sparse 70 | # if it's the case, use a huge sparse matrix 71 | # else use a dense tensor 72 | pos_enc = None 73 | use_pe = hasattr(batch[0], 'pe') and batch[0].pe is not None 74 | if use_pe: 75 | if not batch[0].pe.is_sparse: 76 | pos_enc = torch.zeros((len(batch), max_len, max_len)) 77 | else: 78 | print("Not implemented yet!") 79 | 80 | # process lap PE 81 | lap_pos_enc = None 82 | use_lap_pe = hasattr(batch[0], 'lap_pe') and batch[0].lap_pe is not None 83 | if use_lap_pe: 84 | lap_pe_dim = batch[0].lap_pe.shape[-1] 85 | lap_pos_enc = torch.zeros((len(batch), max_len, lap_pe_dim)) 86 | 87 | degree = None 88 | use_degree = hasattr(batch[0], 'degree') and batch[0].degree is not None 89 | if use_degree: 90 | degree = torch.zeros((len(batch), max_len)) 91 | 92 | for i, g in enumerate(batch): 93 | labels.append(g.y) 94 | g_len = len(g.x) 95 | 96 | if self.n_tags is None: 97 | padded_x[i, :g_len, :] = g.x 98 | else: 99 | padded_x[i, :g_len, :] = g.x_onehot 100 | mask[i, g_len:] = True 101 | if use_pe: 102 | pos_enc[i, :g_len, :g_len] = g.pe 103 | if use_lap_pe: 104 | lap_pos_enc[i, :g_len, :g.lap_pe.shape[-1]] = g.lap_pe 105 | if use_degree: 106 | degree[i, :g_len] = g.degree 107 | 108 | return padded_x, mask, pos_enc, lap_pos_enc, degree, default_collate(labels) 109 | return collate 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GraphiT: Encoding Graph Structure in Transformers 2 | 3 | This repository implements GraphiT, described in the following paper: 4 | 5 | >Grégoire Mialon*, Dexiong Chen*, Margot Selosse*, Julien Mairal. 6 | [GraphiT: Encoding Graph Structure in Transformers][1]. 7 |
*Equal contribution 8 | 9 | ## Short Description about GraphiT 10 | 11 | ![Figure from paper](figures/figure1.png) 12 | 13 | GraphiT is an instance of transformers designed for graph-structured data. It takes as input a graph seen as a set of its node features, and integrates the graph structure via i) relative positional encoding using kernels on graphs and ii) encoding local substructures around each node, e.g, short paths, before adding it to the node features. GraphiT is able to outperform Graph Neural Networks in different graph classification and regression tasks, and offers promising visualization capabilities for domains where interpretability is important, e.g, in chemoinformatics. 14 | 15 | ## Installation 16 | 17 | Environment: 18 | ``` 19 | numpy=1.18.1 20 | scipy=1.3.2 21 | Cython=0.29.23 22 | scikit-learn=0.22.1 23 | matplotlib=3.4 24 | networkx=2.5 25 | python=3.7 26 | pytorch=1.6 27 | torch-geometric=1.7 28 | ``` 29 | 30 | The train folds and model weights for visualization are already provided at the correct location. Datasets will be downloaded via Pytorch geometric. 31 | 32 | To begin with, run: 33 | ``` 34 | cd GraphiT 35 | . s_env 36 | ``` 37 | 38 | To install GCKN, you also need to run: 39 | ``` 40 | make 41 | ``` 42 | 43 | You also need to create a `cache` folder to store computed positional encoding 44 | ``` 45 | mkdir -p cache/pe 46 | ``` 47 | 48 | ## Training GraphiT on graph classification and regression tasks 49 | 50 | All our experimental scripts are in the folder `experiments`. So to start with, run `cd experiments`. 51 | 52 | #### Classification 53 | 54 | To train GraphiT on NCI1 with diffusion kernel, run: 55 | ```bash 56 | python run_transformer_cv.py --dataset NCI1 --fold-idx 1 --pos-enc diffusion --beta 1.0 57 | ``` 58 | 59 | Here `--fold-idx` can be varied from 1 to 10 to train on a specified training fold. To test a selected model, just add the `--test` flag. 60 | 61 | To include Laplacian positional encoding into input node features, run: 62 | ```bash 63 | python run_transformer_cv.py --dataset NCI1 --fold-idx 1 --pos-enc diffusion --beta 1.0 --lappe --lap-dim 8 64 | ``` 65 | 66 | To include GCKN path features into input node features, run: 67 | ```bash 68 | python run_transformer_gckn_cv.py --dataset NCI1 --fold-idx 1 --pos-enc diffusion --beta 1.0 --gckn-path 5 69 | ``` 70 | 71 | ###### Reproduction of our classification results 72 | 73 | To reproduce our experimental results, you need to perform grid search to select the best model and retrain it. We have prepared a script to perform grid search and testing on a single machine for MUTAG with GCKN and adjacency encoding as an example. The results for other datasets and other encodings can be easily obtained by adapting the script. 74 | ```bash 75 | cd scripts 76 | bach -x cv_gckn_transformer.sh 77 | ``` 78 | 79 | You can modify the above script based on your server to conduct grid search on multiple machines. Once all experiments have been done, you can visualize the final results with 80 | ```bash 81 | python results_gckn_transformer.py 82 | ``` 83 | 84 | #### Regression 85 | 86 | To train GraphiT on ZINC, run: 87 | ```bash 88 | python run_transformer.py --pos-enc diffusion --beta 1.0 89 | ``` 90 | 91 | To include Laplacian positional encoding into input node features, run: 92 | ```bash 93 | python run_transformer.py --pos-enc diffusion --beta 1.0 --lappe --lap-dim 8 94 | ``` 95 | 96 | To include GCKN path features into input node features, run: 97 | ```bash 98 | python run_transformer_gckn.py --pos-enc diffusion --beta 1.0 --gckn-path 8 99 | ``` 100 | 101 | ## Visualizing attention scores 102 | 103 | To visualize attention scores for GraphiT trained on Mutagenicity, run: 104 | ``` 105 | cd experiments 106 | python visu_attention.py --idx-sample 10 107 | ``` 108 | To visualize Nitrothiopheneamide-methylbenzene, choose 10 as sample index. 109 | To visualize Aminofluoranthene, choose 2003 as sample index. 110 | If you want to test for other samples (i.e, other indexes), make sure that the model correctly predicts mutagenicity (class 0) for this sample. 111 | 112 | ## Citation 113 | 114 | To cite GraphiT, please use the following Bibtex snippet: 115 | ``` 116 | @misc{mialon2021graphit, 117 | title={GraphiT: Encoding Graph Structure in Transformers}, 118 | author={Gr\'egoire Mialon and Dexiong Chen and Margot Selosse and Julien Mairal}, 119 | year={2021}, 120 | eprint={2106.05667}, 121 | archivePrefix={arXiv}, 122 | primaryClass={cs.LG} 123 | } 124 | ``` 125 | 126 | [1]: https://arxiv.org/abs/2106.05667 127 | -------------------------------------------------------------------------------- /gckn/gckn_fast/gckn_fast.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | template 7 | inline void THBlas_axpy(int64_t n, T a, T *x, int64_t incx, T *y, int64_t incy); 8 | 9 | #define AXPY_SPECIALIZATION(ctype,name) \ 10 | template<> \ 11 | inline void THBlas_axpy(int64_t n, ctype a, ctype *x, int64_t incx, \ 12 | ctype *y, int64_t incy) { \ 13 | TH ## name ## Blas_axpy(n, a, x, incx, y, incy); \ 14 | } 15 | 16 | AT_FORALL_SCALAR_TYPES(AXPY_SPECIALIZATION) 17 | 18 | template 19 | void path_conv_forward_worker( 20 | torch::Tensor output, 21 | const torch::Tensor path_indices, const torch::Tensor features, 22 | int64_t n_paths, int64_t path_size, int64_t feat_path_size, int64_t hidden_size) { 23 | 24 | auto path_indices_accessor = path_indices.accessor(); 25 | scalar_t* features_ptr = features.data_ptr(); 26 | scalar_t* output_ptr = output.data_ptr(); 27 | // scalar_t val = 1. / path_size; 28 | 29 | // int64_t i, j; 30 | // for (i = 0; i < n_paths; ++i) { 31 | // for (j = 0; j < path_size; ++j) { 32 | // int64_t node_idx = path_indices_accessor[i][j]; 33 | // THBlas_axpy(hidden_size, val, 34 | // features_ptr + node_idx * path_size * hidden_size + j * hidden_size, 1, 35 | // output_ptr + i * hidden_size, 1); 36 | // } 37 | // } 38 | torch::parallel_for(0, n_paths, 0, [&](int64_t start, int64_t end) { 39 | for (auto i = start; i < end; i++) { 40 | for (int64_t j = 0; j < path_size; j++) { 41 | int64_t node_idx = path_indices_accessor[i][j]; 42 | THBlas_axpy(hidden_size, 1., 43 | features_ptr + (node_idx * feat_path_size + j) * hidden_size, 1, 44 | output_ptr + i * hidden_size, 1); 45 | } 46 | } 47 | }); 48 | } 49 | 50 | torch::Tensor path_conv_forward_cpu( 51 | torch::Tensor path_indices, 52 | torch::Tensor features) { 53 | // path_indices: n_paths x path_size (value < n_nodes) 54 | // features: n_nodes x path_size x hidden_size x (in_path_size) 55 | // output: n_paths x hidden_size x (in_path_size) 56 | const int64_t n_paths = path_indices.size(0); 57 | const int64_t path_size = path_indices.size(1); 58 | const int64_t feat_path_size = features.size(1); // should be >= path_size 59 | const int64_t hidden_size = features.size(2); 60 | 61 | auto output = torch::zeros({n_paths, hidden_size}, features.options()); 62 | auto commonDtype = promoteTypes(features.scalar_type(), output.scalar_type()); 63 | 64 | AT_DISPATCH_ALL_TYPES( 65 | commonDtype, "path_conv_forward", [&] { 66 | path_conv_forward_worker(output, path_indices, features, n_paths, path_size, feat_path_size, hidden_size); 67 | } 68 | ); 69 | 70 | output /= path_size; 71 | 72 | return output; 73 | } 74 | 75 | template 76 | void path_conv_backward_worker( 77 | torch::Tensor d_input, 78 | const torch::Tensor path_indices, const torch::Tensor d_output, 79 | int64_t n_paths, int64_t path_size, int64_t feat_path_size, int64_t hidden_size) { 80 | 81 | auto path_indices_accessor = path_indices.accessor(); 82 | scalar_t* d_input_ptr = d_input.data_ptr(); 83 | scalar_t* d_output_ptr = d_output.data_ptr(); 84 | // scalar_t val = 1. / path_size; 85 | 86 | torch::parallel_for(0, n_paths, 0, [&](int64_t start, int64_t end) { 87 | for (auto i = start; i < end; ++i) { 88 | for (int64_t j = 0; j < path_size; ++j) { 89 | int64_t node_idx = path_indices_accessor[i][j]; 90 | THBlas_axpy(hidden_size, 1., 91 | d_output_ptr + i * hidden_size, 1, 92 | d_input_ptr + (node_idx * feat_path_size + j) * hidden_size, 1); 93 | } 94 | } 95 | }); 96 | } 97 | 98 | void path_conv_backward_cpu( 99 | torch::Tensor d_input, 100 | torch::Tensor d_output, 101 | torch::Tensor path_indices) { 102 | const int64_t n_paths = path_indices.size(0); 103 | const int64_t path_size = path_indices.size(1); 104 | const int64_t feat_path_size = d_input.size(1); 105 | const int64_t hidden_size = d_output.size(1); 106 | // auto d_input = torch::zeros({n_nodes, path_size, hidden_size}, d_output.options()); 107 | 108 | auto commonDtype = promoteTypes(d_input.scalar_type(), d_output.scalar_type()); 109 | 110 | AT_DISPATCH_ALL_TYPES( 111 | commonDtype, "path_conv_backward", [&] { 112 | path_conv_backward_worker(d_input, path_indices, d_output, n_paths, path_size, feat_path_size, hidden_size); 113 | } 114 | ); 115 | d_input /= path_size; 116 | 117 | } 118 | 119 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { 120 | m.def("path_conv_forward", &path_conv_forward_cpu, "path kernel mapping forward (CPU)"); 121 | m.def("path_conv_backward", &path_conv_backward_cpu, "path kernel mapping backward (CPU)"); 122 | } 123 | -------------------------------------------------------------------------------- /transformer/gckn_pe.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pickle 3 | import torch 4 | import torch.nn.functional as F 5 | import torch_geometric.utils as utils 6 | from gckn.data import PathLoader, S2VGraph 7 | from gckn.models import PathSequential 8 | 9 | 10 | def compute_gckn_pe(train_graphs, test_graphs=None, path_size=3, hidden_size=32, 11 | batch_size=64, sigma=0.5, pooling='mean', 12 | aggregation=True, normalize=False, use_cuda=False): 13 | data_loader = PathLoader(train_graphs, path_size, batch_size, True) 14 | input_size = data_loader.input_size 15 | data_loader.get_all_paths() 16 | 17 | model = PathSequential(input_size, [hidden_size], [path_size], 18 | kernel_args_list=[sigma], pooling=pooling, aggregation=aggregation) 19 | 20 | model.unsup_train(data_loader, n_sampling_paths=300000, use_cuda=use_cuda) 21 | 22 | scaler = None 23 | if normalize: 24 | from sklearn.preprocessing import StandardScaler 25 | train_pe = model.encode(data_loader, use_cuda=use_cuda) 26 | scaler = StandardScaler() 27 | scaler.fit(torch.cat(train_pe, dim=0).numpy()) 28 | train_pe = [torch.from_numpy( 29 | scaler.transform(pe.numpy())) for pe in train_pe] 30 | else: 31 | train_pe = model.encode(data_loader, use_cuda=use_cuda) 32 | 33 | if test_graphs is not None: 34 | data_loader = PathLoader(test_graphs, path_size, batch_size, True) 35 | data_loader.get_all_paths() 36 | test_pe = model.encode(data_loader, use_cuda=use_cuda) 37 | if scaler is not None: 38 | test_pe = [torch.from_numpy( 39 | scaler.transform(pe.numpy())) for pe in test_pe] 40 | return train_pe + test_pe 41 | return train_pe, None 42 | 43 | 44 | def get_adj_list(g): 45 | neighbors = [[] for _ in range(g.num_nodes)] 46 | for k in range(g.edge_index.shape[-1]): 47 | i, j = g.edge_index[:, k] 48 | neighbors[i.item()].append(j.item()) 49 | return neighbors 50 | 51 | def convert_dataset(dataset, n_tags=None): 52 | """Convert a pytorch geometric dataset to gckn dataset 53 | """ 54 | if dataset is None: 55 | return dataset 56 | graph_list = [] 57 | for i, g in enumerate(dataset): 58 | new_g = S2VGraph(g, g.y) 59 | new_g.neighbors = get_adj_list(g) 60 | if n_tags is not None: 61 | new_g.node_features = F.one_hot(g.x.view(-1).long(), n_tags).numpy() 62 | else: 63 | new_g.node_features = g.x.numpy() 64 | degree_list = utils.degree(g.edge_index[0], g.num_nodes).numpy() 65 | new_g.max_neighbor = max(degree_list) 66 | new_g.mean_neighbor = (sum(degree_list) + len(degree_list) - 1) // len(degree_list) 67 | graph_list.append(new_g) 68 | return graph_list 69 | 70 | 71 | class GCKNEncoding(object): 72 | def __init__(self, savepath, dim, path_size, sigma=0.6, pooling='sum', aggregation=True, 73 | normalize=True): 74 | self.savepath = savepath 75 | self.dim = dim 76 | self.path_size = path_size 77 | self.sigma = sigma 78 | self.pooling = pooling 79 | self.aggregation = aggregation 80 | self.normalize = normalize 81 | 82 | self.pos_enc_dim = dim 83 | if aggregation: 84 | self.pos_enc_dim = path_size * dim 85 | 86 | def apply_to(self, train_dset, test_dset=None, batch_size=64, n_tags=None): 87 | """take pytorch geometric dataest as input 88 | """ 89 | saved_pos_enc = self.load() 90 | if saved_pos_enc is not None: 91 | dset_len = len(train_dset) if test_dset is None else len(train_dset) + len(test_dset) 92 | if len(saved_pos_enc) != dset_len: 93 | raise ValueError("Incorrect save path!") 94 | return saved_pos_enc 95 | train_dset = convert_dataset(train_dset, n_tags) 96 | test_dset = convert_dataset(test_dset, n_tags) 97 | pos_enc = compute_gckn_pe( 98 | train_dset, test_dset, path_size=self.path_size, hidden_size=self.dim, 99 | batch_size=batch_size, sigma=self.sigma, pooling=self.pooling, 100 | aggregation=self.aggregation, normalize=self.normalize) 101 | self.save(pos_enc) 102 | return pos_enc 103 | 104 | def save(self, pos_enc): 105 | if self.savepath is None: 106 | return 107 | if not os.path.isfile(self.savepath): 108 | with open(self.savepath, 'wb') as handle: 109 | pickle.dump(pos_enc, handle) 110 | 111 | def load(self): 112 | if not os.path.isfile(self.savepath): 113 | return None 114 | with open(self.savepath, 'rb') as handle: 115 | pos_enc = pickle.load(handle) 116 | return pos_enc 117 | 118 | 119 | if __name__ == "__main__": 120 | from torch_geometric import datasets 121 | data_path = '../dataset/ZINC' 122 | n_tags = 28 123 | dset = datasets.ZINC(data_path, subset=True, split='val') 124 | dset = convert_dataset(dset, 28) 125 | from gckn.graphs import get_paths 126 | graphs_pe = compute_gckn_pe(dset, batch_size=64, aggregation=True) 127 | print(len(graphs_pe)) 128 | print(graphs_pe[0]) 129 | print(graphs_pe[0].shape) 130 | 131 | 132 | -------------------------------------------------------------------------------- /transformer/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import torch 3 | from torch import nn 4 | from .layers import DiffTransformerEncoderLayer 5 | 6 | 7 | class GraphTransformer(nn.Module): 8 | def __init__(self, in_size, nb_class, d_model, nb_heads, 9 | dim_feedforward=2048, dropout=0.1, nb_layers=4, 10 | lap_pos_enc=False, lap_pos_enc_dim=0): 11 | super(GraphTransformer, self).__init__() 12 | 13 | self.embedding = nn.Linear(in_features=in_size, 14 | out_features=d_model, 15 | bias=False) 16 | 17 | self.lap_pos_enc = lap_pos_enc 18 | self.lap_pos_enc_dim = lap_pos_enc_dim 19 | if lap_pos_enc and lap_pos_enc_dim > 0: 20 | # We embed the pos. encoding in a higher dim space 21 | # as Bresson et al. and add it to the features. 22 | self.embedding_lap_pos_enc = nn.Linear(lap_pos_enc_dim, d_model) 23 | encoder_layer = nn.TransformerEncoderLayer( 24 | d_model, nb_heads, dim_feedforward, dropout) 25 | self.encoder = nn.TransformerEncoder(encoder_layer, nb_layers) 26 | self.pooling = GlobalAvg1D() 27 | self.classifier = nn.Sequential( 28 | nn.Linear(d_model, d_model), 29 | nn.ReLU(True), 30 | nn.Linear(d_model, nb_class) 31 | ) 32 | 33 | def forward(self, x, masks, x_pe, x_lap_pos_enc=None, degree=None): 34 | # We permute the batch and sequence following pytorch 35 | # Transformer convention 36 | x = x.permute(1, 0, 2) 37 | output = self.embedding(x) 38 | if self.lap_pos_enc and x_lap_pos_enc is not None: 39 | x_lap_pos_enc = x_lap_pos_enc.transpose(0, 1) 40 | x_lap_pos_enc = self.embedding_lap_pos_enc(x_lap_pos_enc) 41 | output = output + x_lap_pos_enc 42 | output = self.encoder(output, src_key_padding_mask=masks) 43 | output = output.permute(1, 0, 2) 44 | # we make sure to correctly take the masks into account when pooling 45 | output = self.pooling(output, masks) 46 | # we only do mean pooling for now. 47 | return self.classifier(output) 48 | 49 | 50 | class DiffTransformerEncoder(nn.TransformerEncoder): 51 | def forward(self, src, pe, degree=None, mask=None, src_key_padding_mask=None): 52 | output = src 53 | for mod in self.layers: 54 | output = mod(output, pe=pe, degree=degree, src_mask=mask, 55 | src_key_padding_mask=src_key_padding_mask) 56 | if self.norm is not None: 57 | output = self.norm(output) 58 | return output 59 | 60 | 61 | class DiffGraphTransformer(nn.Module): 62 | # This is a variant of the GraphTransformer, where the node positional 63 | # information is injected in the attention score instead of being 64 | # added to the node features. This is in the spirit of relative 65 | # pos encoding rather than Vaswani et al. 66 | def __init__(self, in_size, nb_class, d_model, nb_heads, 67 | dim_feedforward=2048, dropout=0.1, nb_layers=4, 68 | batch_norm=False, lap_pos_enc=False, lap_pos_enc_dim=0): 69 | super(DiffGraphTransformer, self).__init__() 70 | 71 | self.lap_pos_enc = lap_pos_enc 72 | self.lap_pos_enc_dim = lap_pos_enc_dim 73 | if lap_pos_enc and lap_pos_enc_dim > 0: 74 | self.embedding_lap_pos_enc = nn.Linear(lap_pos_enc_dim, d_model) 75 | 76 | self.embedding = nn.Linear(in_features=in_size, 77 | out_features=d_model, 78 | bias=False) 79 | encoder_layer = DiffTransformerEncoderLayer( 80 | d_model, nb_heads, dim_feedforward, dropout, batch_norm=batch_norm) 81 | self.encoder = DiffTransformerEncoder(encoder_layer, nb_layers) 82 | self.pooling = GlobalAvg1D() 83 | #self.classifier = nn.Linear(in_features=d_model, 84 | # out_features=nb_class, bias=True) 85 | self.classifier = nn.Sequential( 86 | nn.Linear(d_model, d_model), 87 | nn.ReLU(True), 88 | nn.Linear(d_model, nb_class) 89 | ) 90 | 91 | def forward(self, x, masks, pe, x_lap_pos_enc=None, degree=None): 92 | # We permute the batch and sequence following pytorch 93 | # Transformer convention 94 | x = x.permute(1, 0, 2) 95 | output = self.embedding(x) 96 | if self.lap_pos_enc and x_lap_pos_enc is not None: 97 | x_lap_pos_enc = x_lap_pos_enc.transpose(0, 1) 98 | x_lap_pos_enc = self.embedding_lap_pos_enc(x_lap_pos_enc) 99 | output = output + x_lap_pos_enc 100 | output = self.encoder(output, pe, degree=degree, src_key_padding_mask=masks) 101 | output = output.permute(1, 0, 2) 102 | # we make sure to correctly take the masks into account when pooling 103 | output = self.pooling(output, masks) 104 | # we only do mean pooling for now. 105 | return self.classifier(output) 106 | 107 | 108 | class GlobalAvg1D(nn.Module): 109 | def __init__(self): 110 | super(GlobalAvg1D, self).__init__() 111 | 112 | def forward(self, x, mask=None): 113 | if mask is None: 114 | return x.mean(dim=1) 115 | mask = (~mask).float().unsqueeze(-1) 116 | x = x * mask 117 | return x.sum(dim=1) / mask.sum(dim=1) 118 | -------------------------------------------------------------------------------- /transformer/position_encoding.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pickle 3 | 4 | import torch 5 | from torch_geometric.utils import get_laplacian, to_scipy_sparse_matrix, to_dense_adj 6 | import numpy as np 7 | import scipy.sparse as sp 8 | from scipy.sparse.linalg import expm 9 | 10 | 11 | class PositionEncoding(object): 12 | def __init__(self, savepath=None, zero_diag=False): 13 | self.savepath = savepath 14 | self.zero_diag = zero_diag 15 | 16 | def apply_to(self, dataset, split='train'): 17 | saved_pos_enc = self.load(split) 18 | all_pe = [] 19 | dataset.pe_list = [] 20 | for i, g in enumerate(dataset): 21 | if saved_pos_enc is None: 22 | pe = self.compute_pe(g) 23 | all_pe.append(pe) 24 | else: 25 | pe = saved_pos_enc[i] 26 | if self.zero_diag: 27 | pe = pe.clone() 28 | pe.diagonal()[:] = 0 29 | dataset.pe_list.append(pe) 30 | 31 | self.save(all_pe, split) 32 | 33 | return dataset 34 | 35 | def save(self, pos_enc, split): 36 | if self.savepath is None: 37 | return 38 | if not os.path.isfile(self.savepath + "." + split): 39 | with open(self.savepath + "." + split, 'wb') as handle: 40 | pickle.dump(pos_enc, handle) 41 | 42 | def load(self, split): 43 | if self.savepath is None: 44 | return None 45 | if not os.path.isfile(self.savepath + "." + split): 46 | return None 47 | with open(self.savepath + "." + split, 'rb') as handle: 48 | pos_enc = pickle.load(handle) 49 | return pos_enc 50 | 51 | def compute_pe(self, graph): 52 | pass 53 | 54 | 55 | class DiffusionEncoding(PositionEncoding): 56 | def __init__(self, savepath, beta=1., use_edge_attr=False, normalization=None, zero_diag=False): 57 | """ 58 | normalization: for Laplacian None. sym or rw 59 | """ 60 | super().__init__(savepath, zero_diag) 61 | self.beta = beta 62 | self.normalization = normalization 63 | self.use_edge_attr = use_edge_attr 64 | 65 | def compute_pe(self, graph): 66 | edge_attr = graph.edge_attr if self.use_edge_attr else None 67 | edge_index, edge_attr = get_laplacian( 68 | graph.edge_index, edge_attr, normalization=self.normalization, 69 | num_nodes=graph.num_nodes) 70 | L = to_scipy_sparse_matrix(edge_index, edge_attr).tocsc() 71 | L = expm(-self.beta * L) 72 | return torch.from_numpy(L.toarray()) 73 | 74 | 75 | class PStepRWEncoding(PositionEncoding): 76 | def __init__(self, savepath, p=1, beta=0.5, use_edge_attr=False, normalization=None, zero_diag=False): 77 | super().__init__(savepath, zero_diag) 78 | self.p = p 79 | self.beta = beta 80 | self.normalization = normalization 81 | self.use_edge_attr = use_edge_attr 82 | 83 | def compute_pe(self, graph): 84 | edge_attr = graph.edge_attr if self.use_edge_attr else None 85 | edge_index, edge_attr = get_laplacian( 86 | graph.edge_index, edge_attr, normalization=self.normalization, 87 | num_nodes=graph.num_nodes) 88 | L = to_scipy_sparse_matrix(edge_index, edge_attr).tocsc() 89 | L = sp.identity(L.shape[0], dtype=L.dtype) - self.beta * L 90 | tmp = L 91 | for _ in range(self.p - 1): 92 | tmp = tmp.dot(L) 93 | return torch.from_numpy(tmp.toarray()) 94 | 95 | 96 | class AdjEncoding(PositionEncoding): 97 | def __init__(self, savepath, normalization=None, zero_diag=False): 98 | """ 99 | normalization: for Laplacian None. sym or rw 100 | """ 101 | super().__init__(savepath, zero_diag) 102 | self.normalization = normalization 103 | 104 | def compute_pe(self, graph): 105 | return to_dense_adj(graph.edge_index) 106 | 107 | class FullEncoding(PositionEncoding): 108 | def __init__(self, savepath, zero_diag=False): 109 | """ 110 | normalization: for Laplacian None. sym or rw 111 | """ 112 | super().__init__(savepath, zero_diag) 113 | 114 | def compute_pe(self, graph): 115 | return torch.ones((graph.num_nodes, graph.num_nodes)) 116 | 117 | ## Absolute position encoding 118 | class LapEncoding(PositionEncoding): 119 | def __init__(self, dim, use_edge_attr=False, normalization=None): 120 | """ 121 | normalization: for Laplacian None. sym or rw 122 | """ 123 | self.pos_enc_dim = dim 124 | self.normalization = normalization 125 | self.use_edge_attr = use_edge_attr 126 | 127 | def compute_pe(self, graph): 128 | edge_attr = graph.edge_attr if self.use_edge_attr else None 129 | edge_index, edge_attr = get_laplacian( 130 | graph.edge_index, edge_attr, normalization=self.normalization) 131 | L = to_scipy_sparse_matrix(edge_index, edge_attr).tocsc() 132 | EigVal, EigVec = np.linalg.eig(L.toarray()) 133 | idx = EigVal.argsort() # increasing order 134 | EigVal, EigVec = EigVal[idx], np.real(EigVec[:,idx]) 135 | return torch.from_numpy(EigVec[:, 1:self.pos_enc_dim+1]).float() 136 | 137 | def apply_to(self, dataset): 138 | dataset.lap_pe_list = [] 139 | for i, g in enumerate(dataset): 140 | pe = self.compute_pe(g) 141 | dataset.lap_pe_list.append(pe) 142 | 143 | return dataset 144 | 145 | 146 | POSENCODINGS = { 147 | "diffusion": DiffusionEncoding, 148 | "pstep": PStepRWEncoding, 149 | "adj": AdjEncoding, 150 | } 151 | -------------------------------------------------------------------------------- /scripts/results_gckn_transformer.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | DATASET = 'MUTAG' 4 | OUTPATH = '../logs_cv_gckn_trans/transformer/{}/gckn_{}_{}_{}_{}_True_True/{}_{}_{}_{}_{}_{}_{}_{}_{}_{}_{}/fold-{}/logs{}.csv' 5 | MODE = 'test' 6 | LOGPATH = '../logs_cv_gckn_trans/transformer/{}/best_model.pkl'.format(DATASET) 7 | 8 | 9 | def selection_model(fold_idx, pos_enc='diffusion', p=1, lappe=False, lap_dim=3): 10 | gckn_dim_grid = [32] 11 | gckn_path_grid = [5, 7] 12 | gckn_sigma_grid = [0.6] 13 | gckn_pooling_grid = ['sum'] 14 | heads_grid = [1, 4, 8] 15 | layers_grid = range(1, 5) 16 | hidden_grid = [32, 64, 128] 17 | beta_grid = {'pstep': [0.5, 1.0], 'diffusion': [1.0,]} 18 | normalize_grid = ['sym'] 19 | lr_grid = [0.001] 20 | wd_grid = [0.01, 0.001, 0.0001] 21 | dropouts = [0.0, 0.1] 22 | abs_PE = 'NoPE' if not lappe else 'Lap{}'.format(lap_dim) 23 | 24 | test_metric = ['test_acc', 'test_loss'] 25 | 26 | param_names = ['gckn_path', 'gckn_dim', 'gckn_sigma', 'gckn_pooling', 27 | 'wd', 'dropout', 'nb_heads', 'nb_layers', 'dim_hidden', 'lr', 'pos_enc', 'normalization', 'p', 'beta', 'fold'] 28 | all_results = [] 29 | num_results = 0 30 | 31 | for gckn_path in gckn_path_grid: 32 | for gckn_dim in gckn_dim_grid: 33 | for gckn_sigma in gckn_sigma_grid: 34 | for gckn_pooling in gckn_pooling_grid: 35 | for head in heads_grid: 36 | for layer in layers_grid: 37 | for hidden in hidden_grid: 38 | for lr in lr_grid: 39 | for wd in wd_grid: 40 | for normalize in normalize_grid: 41 | for beta in beta_grid[pos_enc]: 42 | for dropout in dropouts: 43 | 44 | path = OUTPATH.format( 45 | DATASET, 46 | gckn_path, gckn_dim, gckn_sigma, gckn_pooling, 47 | wd, dropout, lr, layer, head, hidden, 48 | 'LN', pos_enc, normalize, p, beta, fold_idx, '') 49 | path_test = OUTPATH.format( 50 | DATASET, 51 | gckn_path, gckn_dim, gckn_sigma, gckn_pooling, 52 | wd, dropout, lr, layer, head, hidden, 53 | 'LN', pos_enc, normalize, p, beta, fold_idx, '_test') 54 | try: 55 | metric_train = pd.read_csv(path, index_col=0) 56 | if MODE == 'val': 57 | metric_test = metric_train.copy() 58 | else: 59 | metric_test = pd.read_csv(path_test, index_col=0) 60 | num_results += 1 61 | except Exception: 62 | continue 63 | metric = pd.DataFrame(metric_train.iloc[-50:].mean()).T 64 | metric_test_avg = metric_test.iloc[-50:].mean() 65 | for tm in test_metric: 66 | metric[tm] = metric_test_avg[tm] 67 | metric['val_acc_std'] = metric_train.iloc[-50:]['val_acc'].std() 68 | metric['test_acc_std'] = metric_test.iloc[-50:]['test_acc'].std() 69 | params = [gckn_path, gckn_dim, gckn_sigma, gckn_pooling, 70 | wd, dropout, head, layer, hidden, lr, pos_enc, normalize, p, beta, fold_idx] 71 | for param, param_name in zip(params, param_names): 72 | metric[param_name] = [param] 73 | all_results.append(metric) 74 | all_results = pd.concat(all_results) 75 | best_model = all_results.loc[all_results['val_acc'] == all_results['val_acc'].max()] 76 | best_model = best_model.iloc[[best_model['val_acc_std'].idxmin()]] 77 | return best_model 78 | 79 | def main(): 80 | """ 81 | This functions reads all the experiment results given a parameter grid 82 | and outputs the scores and best models per fold as well as a global 83 | score. 84 | """ 85 | 86 | results = [] 87 | pos_enc = 'pstep' 88 | p = 1 89 | lappe = False 90 | lap_dim = 2 91 | best_params = [] 92 | for fold_idx in range(1, 11): 93 | model = selection_model(fold_idx, pos_enc, p, lappe, lap_dim) 94 | results.append(model) 95 | best_params.append(model.iloc[0].to_dict()) 96 | 97 | table = pd.concat(results) 98 | main_info = ['val_acc', 'test_acc', 'gckn_path', 'wd', 'dropout', 'nb_heads', 'nb_layers', 'dim_hidden', 'lr', 'pos_enc', 'normalization', 'p', 'beta', 'fold'] 99 | print(table[main_info]) 100 | print("final acc: {}".format(table['test_acc'].mean())) 101 | print("final acc std: {}".format(table['test_acc'].std())) 102 | import pickle 103 | if MODE == 'val': 104 | with open(LOGPATH, 'wb') as handle: 105 | pickle.dump(best_params, handle) 106 | 107 | 108 | if __name__ == "__main__": 109 | main() 110 | --------------------------------------------------------------------------------