-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Launcher for training with the possibility to specify hyperparameters. This script is to be used by wandb-sweep. | ||
https://docs.wandb.ai/guides/sweeps | ||
Input: template JSON ivadomed config file, which will be edited by this script to insert the random parameters. | ||
Resumption of interrupted runs with | ||
python train_wandb_sweep_hyperparam.py --resume | ||
""" | ||
|
||
import sys | ||
|
||
import wandb | ||
from wandb.keras import WandbCallback | ||
|
||
|
||
defaults = dict( | ||
dropout=0.2, | ||
hidden_layer_size=128, | ||
layer_1_size=16, | ||
layer_2_size=32, | ||
learn_rate=0.01, | ||
decay=1e-6, | ||
momentum=0.9, | ||
epochs=27, | ||
) | ||
|
||
resume = sys.argv[-1] == "--resume" | ||
wandb.init(config=defaults, resume=resume) | ||
|
||
# This is where the parameters are read from the YAML file | ||
config = wandb.config | ||
|
||
# Build ivadomed's config file based on the generated parameters | ||
# TODO | ||
|
||
# Call to ivadomed | ||
ivadomed.main() |