Skip to content

Commit 0bdaa71

Browse files
committed
Use wandb groups to log similar runs
1 parent e444133 commit 0bdaa71

File tree

7 files changed

+37
-11
lines changed

7 files changed

+37
-11
lines changed

code2seq/utils/train.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from os.path import basename
2-
31
import torch
42
from commode_utils.callback import PrintEpochResultCallback, ModelCheckpointWithUpload
53
from omegaconf import DictConfig
@@ -13,9 +11,13 @@ def train(model: LightningModule, data_module: LightningDataModule, config: Dict
1311
params = config.train
1412

1513
# define logger
16-
model_name = model.__class__.__name__
17-
dataset_name = basename(config.data_folder)
18-
wandb_logger = WandbLogger(project=f"{model_name} -- {dataset_name}", log_model=False, offline=config.log_offline)
14+
wandb_logger = WandbLogger(
15+
project=config.wandb.project,
16+
group=config.wandb.group,
17+
log_model=False,
18+
offline=config.wandb.offline,
19+
config=config,
20+
)
1921

2022
# define model checkpoint callback
2123
checkpoint_callback = ModelCheckpointWithUpload(

config/code2class-poj104.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/poj-104/poj-104-code2seq
33
checkpoint: null
44

55
seed: 7
6-
log_offline: true
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Code2Class -- poj-104
12+
group: null
13+
offline: full
14+
1115
data:
1216
url: https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/poj-104/poj-104-code2seq.tar.gz
1317
num_workers: 0

config/code2seq-java-med.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/code2seq/java-med
33
checkpoint: null
44

55
seed: 7
6-
log_offline: false
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Code2Seq -- java-med
12+
group: null
13+
offline: false
14+
1115
data:
1216
url: https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/java-paths-methods/java-med.tar.gz
1317
num_workers: 4

config/code2seq-java-small.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/code2seq/java-small
33
checkpoint: null
44

55
seed: 7
6-
log_offline: false
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Code2Seq -- java-small
12+
group: null
13+
offline: false
14+
1115
data:
1216
url: https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/java-paths-methods/java-small.tar.gz
1317
num_workers: 4

config/code2seq-java-test.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/code2seq/java-test
33
checkpoint: null
44

55
seed: 7
6-
log_offline: true
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Test project
12+
group: Test group
13+
offline: true
14+
1115
data:
1216
num_workers: 0
1317

config/typed-code2seq-java-small.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/code2seq/java-small
33
checkpoint: null
44

55
seed: 7
6-
log_offline: false
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Code2Seq -- java-small
12+
group: typed
13+
offline: false
14+
1115
data:
1216
url: https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/java-paths-methods/java-small.tar.gz
1317
num_workers: 4

config/typed-code2seq-java-test.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ data_folder: ../data/code2seq/java-test-typed
33
checkpoint: null
44

55
seed: 7
6-
log_offline: true
76
# Training in notebooks (e.g. Google Colab) may crash with too small value
87
progress_bar_refresh_rate: 1
98
print_config: true
109

10+
wandb:
11+
project: Test project
12+
group: Test group
13+
offline: true
14+
1115
data:
1216
num_workers: 0
1317

0 commit comments

Comments
 (0)