Skip to content

Commit a206cb7

Browse files
Changes for experimentats
1 parent 7a006ff commit a206cb7

22 files changed

Lines changed: 615 additions & 53 deletions

check.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from pathlib import Path
2+
3+
import yaml
4+
import pandas as pd
5+
6+
7+
SEEDS = [42, 1234, 1337]
8+
MODELS = ["rf", "svm", "xgb", "mlp", "gnngly", "sweetnet", "rgcn", "gifflar"]
9+
DATASETS = ["Glycosylation", "Tissue", "Taxonomy_Kingdom", "Spectrum"]
10+
BASE = Path("/") / "scratch" / "SCRATCH_SAS" / "roman" / "Gothenburg" / "GIFFLAR" / "logs_final"
11+
12+
hits = {}
13+
for seed in SEEDS:
14+
hits[seed] = pd.DataFrame(index=DATASETS, columns=MODELS, dtype=int)
15+
16+
for model in MODELS:
17+
for version in sorted([p for p in (BASE / model).iterdir() if p.is_dir()], key=lambda x: int(x.name.split("_")[1]), reverse=True):
18+
if not (version / "hparams.yaml").exists() or not (version / "metrics.csv").exists():
19+
continue
20+
with open(version / "hparams.yaml", "r") as file:
21+
hparams = yaml.load(file, Loader=yaml.FullLoader)
22+
seed = hparams["seed"]
23+
dataset = hparams["dataset"]["name"]
24+
metrics = pd.read_csv(version / "metrics.csv")
25+
if hits[seed].at[dataset, model] == 1:
26+
continue
27+
hits[seed].at[dataset, model] = int(len(metrics) == 3 or metrics["epoch"].max() >= 99)
28+
if "epoch" in metrics.columns and metrics["epoch"].max() < 99:
29+
print(seed, dataset, model, metrics["epoch"].max())
30+
31+
for seed in SEEDS:
32+
print(seed)
33+
print(hits[seed].to_markdown())

collect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def order_models(name: str) -> tuple:
3737
root = Path(sys.argv[1])
3838
models = sorted(filter(lambda x: selection is None or x in selection, [str(x).split("/")[-1] for x in root.iterdir() if x.is_dir()]), key=lambda x: order_models(x))
3939
# print(models)
40-
datasets = ["Immunogenicity", "Glycosylation", "Domain", "Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"]
40+
datasets = ["Immunogenicity", "Glycosylation", "Tissue", "Domain", "Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"]
4141
df = pd.DataFrame(index=datasets, columns=models, dtype=float)
4242
df.fillna(-1.0, inplace=True)
4343
for model in models:
@@ -72,4 +72,3 @@ def order_models(name: str) -> tuple:
7272
worksheet.write(r + 1, c + 1, val, bold_format)
7373
except:
7474
pass
75-
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
seed: 1234
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
4+
datasets:
5+
- name: Glycosylation
6+
task: classification
7+
pre-transforms:
8+
GIFFLARTransform:
9+
GNNGLYTransform:
10+
ECFPTransform:
11+
SweetNetTransform:
12+
RGCNTransform:
13+
RandomWalkPE:
14+
dim: 20
15+
individual: False
16+
LaplacianPE:
17+
dim: 20
18+
individual: False
19+
model:
20+
- name: gnngly
21+
feat_dim: 128
22+
hidden_dim: 1024
23+
batch_size: 512
24+
num_layers: 8
25+
epochs: 100
26+
patience: 30
27+
learning_rate: 0.001
28+
optimizer: Adam
29+
suffix:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
seed: 42
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
4+
datasets:
5+
- name: Taxonomy_Kingdom
6+
task: multilabel
7+
pre-transforms:
8+
GIFFLARTransform:
9+
GNNGLYTransform:
10+
ECFPTransform:
11+
SweetNetTransform:
12+
RGCNTransform:
13+
RandomWalkPE:
14+
dim: 20
15+
individual: False
16+
LaplacianPE:
17+
dim: 20
18+
individual: False
19+
model:
20+
- name: sweetnet
21+
feat_dim: 128
22+
hidden_dim: 256
23+
batch_size: 256
24+
num_layers: 16
25+
epochs: 100
26+
patience: 30
27+
learning_rate: 0.001
28+
optimizer: Adam
29+
suffix:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
seed: 1234
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
4+
datasets:
5+
- name: Taxonomy_Kingdom
6+
task: multilabel
7+
pre-transforms:
8+
GIFFLARTransform:
9+
GNNGLYTransform:
10+
ECFPTransform:
11+
SweetNetTransform:
12+
RGCNTransform:
13+
RandomWalkPE:
14+
dim: 20
15+
individual: False
16+
LaplacianPE:
17+
dim: 20
18+
individual: False
19+
model:
20+
- name: gifflar
21+
feat_dim: 128
22+
hidden_dim: 256
23+
batch_size: 128
24+
num_layers: 8
25+
epochs: 100
26+
learning_rate: 0.001
27+
optimizer: Adam
28+
pooling: global_mean
29+
suffix:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
seed: 42
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
4+
datasets:
5+
- name: Tissue
6+
task: multilabel
7+
pre-transforms:
8+
GIFFLARTransform:
9+
GNNGLYTransform:
10+
ECFPTransform:
11+
SweetNetTransform:
12+
RGCNTransform:
13+
RandomWalkPE:
14+
dim: 20
15+
individual: False
16+
LaplacianPE:
17+
dim: 20
18+
individual: False
19+
model:
20+
- name: rgcn
21+
feat_dim: 128
22+
hidden_dim: 1024
23+
batch_size: 16
24+
num_layers: 8
25+
epochs: 100
26+
learning_rate: 0.001
27+
optimizer: Adam
28+
suffix:
29+
- name: gifflar
30+
feat_dim: 128
31+
hidden_dim: 1024
32+
batch_size: 16
33+
num_layers: 8
34+
epochs: 100
35+
learning_rate: 0.001
36+
optimizer: Adam
37+
pooling: global_mean
38+
suffix:
39+

configs/downstream/final_ml.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
seed: [42, 1234, 1337]
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final_small
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final_small
4+
datasets:
5+
- name: Glycosylation
6+
task: classification
7+
- name: Tissue
8+
task: multilabel
9+
- name: Taxonomy_Kingdom
10+
task: multilabel
11+
pre-transforms:
12+
GIFFLARTransform:
13+
GNNGLYTransform:
14+
ECFPTransform:
15+
SweetNetTransform:
16+
RGCNTransform:
17+
RandomWalkPE:
18+
dim: 20
19+
individual: False
20+
LaplacianPE:
21+
dim: 20
22+
individual: False
23+
model:
24+
- name: sweetnet
25+
feat_dim: 128
26+
hidden_dim: 256
27+
batch_size: 256
28+
num_layers: 16
29+
epochs: 100
30+
patience: 30
31+
learning_rate: 0.001
32+
optimizer: Adam
33+
suffix:
34+
- name: gnngly
35+
feat_dim: 128
36+
hidden_dim: 256
37+
batch_size: 256
38+
num_layers: 8
39+
epochs: 100
40+
patience: 30
41+
learning_rate: 0.001
42+
optimizer: Adam
43+
suffix:
44+
- name: rgcn
45+
feat_dim: 128
46+
hidden_dim: 256
47+
batch_size: 64
48+
num_layers: 8
49+
epochs: 100
50+
learning_rate: 0.001
51+
optimizer: Adam
52+
suffix:
53+
- name: gifflar
54+
feat_dim: 128
55+
hidden_dim: 256
56+
batch_size: 128
57+
num_layers: 8
58+
epochs: 100
59+
learning_rate: 0.001
60+
optimizer: Adam
61+
pooling: global_mean
62+
suffix:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
seed: 1337
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final_small
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final_small
4+
datasets:
5+
- name: Glycosylation
6+
task: classification
7+
pre-transforms:
8+
GIFFLARTransform:
9+
GNNGLYTransform:
10+
ECFPTransform:
11+
SweetNetTransform:
12+
RGCNTransform:
13+
RandomWalkPE:
14+
dim: 20
15+
individual: False
16+
LaplacianPE:
17+
dim: 20
18+
individual: False
19+
model:
20+
- name: gifflar
21+
feat_dim: 128
22+
hidden_dim: 1024
23+
batch_size: 64
24+
num_layers: 8
25+
epochs: 2
26+
learning_rate: 0.001
27+
optimizer: Adam
28+
pooling: global_mean
29+
suffix:

configs/downstream/final_sl.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
seed: [42, 1234, 1337]
2+
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
3+
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
4+
datasets:
5+
- name: Glycosylation
6+
task: classification
7+
- name: Taxonomy_Kingdom
8+
task: multilabel
9+
pre-transforms:
10+
GIFFLARTransform:
11+
GNNGLYTransform:
12+
ECFPTransform:
13+
SweetNetTransform:
14+
RGCNTransform:
15+
RandomWalkPE:
16+
dim: 20
17+
individual: False
18+
LaplacianPE:
19+
dim: 20
20+
individual: False
21+
model:
22+
- name: rf
23+
n_estimators: 500
24+
n_jobs: -1
25+
random_state: 42
26+
- name: svm
27+
random_state: 42
28+
- name: xgb
29+
random_state: 42
30+
- name: mlp
31+
feat_dim: 1024
32+
hidden_dim: 1024
33+
batch_size: 256
34+
num_layers: 3
35+
epochs: 100
36+
patience: 30
37+
learning_rate: 0.001
38+
optimizer: Adam
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ seed: [42, 1234, 1337]
22
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data_final
33
logs_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/logs_final
44
datasets:
5-
- name: Taxonomy_Kingdom
6-
task: multilabel
7-
- name: Tissue
8-
task: multilabel
9-
- name: Glycosylation
10-
task: classification
115
- name: Spectrum
126
task: spectrum
137
pre-transforms:
@@ -23,18 +17,10 @@ pre-transforms:
2317
dim: 20
2418
individual: False
2519
model:
26-
- name: rf
27-
n_estimators: 500
28-
n_jobs: -1
29-
random_state: 42
30-
- name: svm
31-
random_state: 42
32-
- name: xgb
33-
random_state: 42
3420
- name: mlp
3521
feat_dim: 1024
3622
hidden_dim: 1024
37-
batch_size: 256
23+
batch_size: 16
3824
num_layers: 3
3925
epochs: 100
4026
patience: 30
@@ -43,7 +29,7 @@ model:
4329
- name: sweetnet
4430
feat_dim: 128
4531
hidden_dim: 1024
46-
batch_size: 512
32+
batch_size: 64
4733
num_layers: 16
4834
epochs: 100
4935
patience: 30
@@ -53,7 +39,7 @@ model:
5339
- name: gnngly
5440
feat_dim: 128
5541
hidden_dim: 1024
56-
batch_size: 512
42+
batch_size: 16
5743
num_layers: 8
5844
epochs: 100
5945
patience: 30
@@ -63,7 +49,7 @@ model:
6349
- name: rgcn
6450
feat_dim: 128
6551
hidden_dim: 1024
66-
batch_size: 256
52+
batch_size: 16
6753
num_layers: 8
6854
epochs: 100
6955
learning_rate: 0.001
@@ -72,7 +58,7 @@ model:
7258
- name: gifflar
7359
feat_dim: 128
7460
hidden_dim: 1024
75-
batch_size: 256
61+
batch_size: 16
7662
num_layers: 8
7763
epochs: 100
7864
learning_rate: 0.001

0 commit comments

Comments
 (0)