Skip to content

Commit

Permalink
Setup for clean run
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Joeres authored and Roman Joeres committed Aug 19, 2024
1 parent 051277e commit c9b632c
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 94 deletions.
79 changes: 40 additions & 39 deletions configs/downstream/all.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,66 @@
seed: 42
data_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data
logs_dir: logs
datasets:
- name: Immunogenicity
task: classification
- name: Glycosylation
task: classification
#- name: Immunogenicity
# task: classification
#- name: Glycosylation
# task: classification
- name: Taxonomy_Domain
task: multilabel
- name: Taxonomy_Phylum
task: multilabel
- name: Taxonomy_Class
task: multilabel
- name: Taxonomy_Order
task: multilabel
- name: Taxonomy_Family
task: multilabel
- name: Taxonomy_Genus
task: multilabel
- name: Taxonomy_Species
task: multilabel
#- name: Taxonomy_Phylum
# task: multilabel
#- name: Taxonomy_Class
# task: multilabel
#- name: Taxonomy_Order
# task: multilabel
#- name: Taxonomy_Family
# task: multilabel
#- name: Taxonomy_Genus
# task: multilabel
#- name: Taxonomy_Species
# task: multilabel
pre-transforms:
model:
- name: rf
n_estimators: 500
n_jobs: -1
random_state: 42
- name: svm
random_state: 42
- name: xgb
random_state: 42
#- name: rf
# n_estimators: 500
# n_jobs: -1
# random_state: 42
#- name: svm
# random_state: 42
#- name: xgb
# random_state: 42
- name: mlp
hidden_dim: 1024
batch_size: 256
num_layers: 3
epochs: 100
epochs: 1
patience: 30
learning_rate: 0
optimizer: Adam
- name: sweetnet
hidden_dim: 768
batch_size: 256
epochs: 50
hidden_dim: 1024
batch_size: 512
epochs: 1
patience: 30
learning_rate: 0.001
optimizer: Adam
suffix: _768
suffix:
- name: gnngly
hidden_dim: 14
batch_size: 256
hidden_dim: 1024
batch_size: 512
num_layers: 5
epochs: 200
epochs: 1
patience: 30
learning_rate: 0
learning_rate: 0.001
optimizer: Adam
suffix: _5_14
suffix:
- name: gifflar
hidden_dim: 768
batch_size: 32
num_layers: 6
epochs: 100
hidden_dim: 1024
batch_size: 512
num_layers: 8
epochs: 1
learning_rate: 0.001
optimizer: Adam
suffix: _768_6
suffix:
39 changes: 39 additions & 0 deletions configs/downstream/both.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
seed: 42
data_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data
logs_dir: logs
datasets:
- name: Immunogenicity
task: classification
- name: Glycosylation
task: classification
- name: Taxonomy_Domain
task: multilabel
- name: Taxonomy_Kingdom
task: multilabel
- name: Taxonomy_Phylum
task: multilabel
- name: Taxonomy_Class
task: multilabel
- name: Taxonomy_Order
task: multilabel
- name: Taxonomy_Family
task: multilabel
- name: Taxonomy_Genus
task: multilabel
- name: Taxonomy_Species
task: multilabel
pre-transforms:
LaplacianPE:
dim: 20
RandomWalkPE:
dim: 20
model:
- name: gifflar
hidden_dim: 1024
batch_size: 512
num_layers: 8
epochs: 100
learning_rate: 0.001
optimizer: Adam
suffix: _both
21 changes: 0 additions & 21 deletions configs/downstream/dl.yaml

This file was deleted.

32 changes: 7 additions & 25 deletions configs/downstream/gnngly.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
seed: 42
data_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data
logs_dir: logs
datasets:
# - name: Immunogenicity
# task: classification
# - name: Glycosylation
# task: classification
# - name: Taxonomy_Domain
# task: multilabel
# - name: Taxonomy_Kingdom
# task: multilabel
# - name: Taxonomy_Phylum
# task: multilabel
# - name: Taxonomy_Class
# task: multilabel
# - name: Taxonomy_Order
# task: multilabel
# - name: Taxonomy_Family
# task: multilabel
# - name: Taxonomy_Genus
# task: multilabel
# - name: Taxonomy_Species
# task: multilabel
- name: Taxonomy_Domain
task: multilabel
pre-transforms:
model:
- name: gnngly
hidden_dim: 14
batch_size: 256
hidden_dim: 1024
batch_size: 512
num_layers: 5
epochs: 200
epochs: 1
patience: 30
learning_rate: 0
learning_rate: 0.001
optimizer: Adam
suffix: _5_14
11 changes: 6 additions & 5 deletions configs/downstream/dev.yaml → configs/downstream/lppe.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
seed: 42
data_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data
logs_dir: logs_1024_10
logs_dir: logs
datasets:
- name: Immunogenicity
task: classification
Expand All @@ -24,13 +24,14 @@ datasets:
- name: Taxonomy_Species
task: multilabel
pre-transforms:
LaplacianPE:
dim: 20
model:
- name: gifflar
hidden_dim: 1024
batch_size: 33
num_layers: 5
batch_size: 512
num_layers: 8
epochs: 100
learning_rate: 0.001
optimizer: Adam
suffix: _1024_5

suffix: _lp
37 changes: 37 additions & 0 deletions configs/downstream/rwpe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
seed: 42
data_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/
root_dir: /scratch/SCRATCH_SAS/roman/Gothenburg/GIFFLAR/data
logs_dir: logs
datasets:
- name: Immunogenicity
task: classification
- name: Glycosylation
task: classification
- name: Taxonomy_Domain
task: multilabel
- name: Taxonomy_Kingdom
task: multilabel
- name: Taxonomy_Phylum
task: multilabel
- name: Taxonomy_Class
task: multilabel
- name: Taxonomy_Order
task: multilabel
- name: Taxonomy_Family
task: multilabel
- name: Taxonomy_Genus
task: multilabel
- name: Taxonomy_Species
task: multilabel
pre-transforms:
RandomWalkPE:
dim: 20
model:
- name: gifflar
hidden_dim: 1024
batch_size: 512
num_layers: 8
epochs: 100
learning_rate: 0.001
optimizer: Adam
suffix: _rw
6 changes: 3 additions & 3 deletions gifflar/baselines/gnngly.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init__(self, output_dim, task, **kwargs):
"""
super().__init__(14, output_dim, task)

del self.convs
del self.head
# del self.convs
# del self.head

# Five layers of plain graph convolution with a hidden dimension of 14.
self.layers = [
Expand Down Expand Up @@ -71,7 +71,7 @@ def forward(self, batch):
Dict holding the node embeddings, the graph embedding, and the final model prediction
"""
# Extract atomic graph from the heterogeneous graph
x = batch["gnngly_x"]
x = batch["gnngly_x"].float()
batch_ids = batch["gnngly_batch"]
edge_index = batch["gnngly_edge_index"]

Expand Down
2 changes: 1 addition & 1 deletion gifflar/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setup(**kwargs):
pre_transform=get_pretransforms(**(kwargs["pre-transforms"] or {})), **data_config,
)
data_config["num_classes"] = datamodule.train.dataset_args["num_classes"]
logger = CSVLogger(kwargs["logs_dir"], name=kwargs["model"]["name"] + kwargs["model"].get("suffix", ""))
logger = CSVLogger(kwargs["logs_dir"], name=kwargs["model"]["name"] + (kwargs["model"].get("suffix", None) or ""))
kwargs["dataset"]["filepath"] = str(data_config["filepath"])
logger.log_hyperparams(kwargs)
metrics = get_metrics(data_config["task"], data_config["num_classes"])
Expand Down

0 comments on commit c9b632c

Please sign in to comment.