-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PR/AUROC curve. Fix wandb log_table logic. Fix regression earlyst…
…op criteria
- Loading branch information
Showing
8 changed files
with
71 additions
and
39 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
_target_: pytorch_lightning.callbacks.early_stopping.EarlyStopping | ||
monitor: epoch/valid_BinaryF1Score | ||
mode: max | ||
patience: 10 | ||
_target_: pytorch_lightning.callbacks.early_stopping.EarlyStopping | ||
monitor: epoch/valid_BinaryF1Score | ||
mode: max | ||
patience: 10 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
_target_: pytorch_lightning.callbacks.early_stopping.EarlyStopping | ||
monitor: epoch/valid_MeanSquaredError | ||
mode: max | ||
mode: min | ||
patience: 10 |
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,21 @@ | ||
name: "ADNI Sweep" | ||
description: "HPO for ADNI classification task" | ||
method: bayes | ||
metric: | ||
goal: maximize | ||
name: test_acc | ||
parameters: | ||
model: | ||
values: [ resnet_binary , convnext_binary ] | ||
optim: | ||
values: [ adamw , lion ] | ||
scheduler: | ||
values: [ exp_decay , cosine_anneal_warmup ] | ||
optim.lr: | ||
values: [ 5e-3 , 1e-3 , 1e-4 , 5e-5 ] | ||
early_terminate: | ||
type: hyperband | ||
s: 2 | ||
eta: 3 | ||
max_iter: 27 | ||
run_cap: 50 |
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
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
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
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
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 |
---|---|---|
@@ -1,9 +1,39 @@ | ||
export HYDRA_FULL_ERROR=1 | ||
export CUDA_VISIBLE_DEVICES=1 | ||
|
||
python sweep.py --sweep_cfg_name=ppmi_sweep.yaml\ | ||
--wandb_project=ppmi\ | ||
--config_name=train_binary.yaml\ | ||
--sweep_prefix='Scratch' | ||
# --overrides="['module.load_model_ckpt=meta_brain/weights/default/resnet10-42/156864-valid_mae3.465.ckpt',\ | ||
# '+module.load_model_strict=False']" | ||
|
||
read -p "Enter devices: " device | ||
export CUDA_VISIBLE_DEVICES=$device | ||
|
||
read -p "Enter devices: ppmi|adni " ds | ||
dataset=$ds | ||
|
||
sweep_ppmi() { | ||
echo "Sweep on PPMI" | ||
python sweep.py --sweep_cfg_name=ppmi_sweep.yaml\ | ||
--wandb_project=ppmi\ | ||
--config_name=train_binary.yaml\ | ||
--sweep_prefix='Scratch'\ | ||
--overrides="['dataset=ppmi_binary', \ | ||
'+dataset.modality=[t2]', \ | ||
'dataloader.batch_size=4', \ | ||
'dataloader.num_workers=2', \ | ||
'trainer.accumulate_grad_batches=8']" | ||
} | ||
|
||
sweep_adni() { | ||
echo "Sweep on ADNI" | ||
python sweep.py --sweep_cfg_name=adni_sweep.yaml\ | ||
--wandb_project=adni\ | ||
--config_name=train_binary.yaml\ | ||
--sweep_prefix='Scratch'\ | ||
--overrides="['dataset=adni']" | ||
} | ||
|
||
# Check the input argument and call the appropriate function | ||
if [ $dataset = "ppmi" ]; then | ||
sweep_ppmi | ||
elif [ $dataset = "adni" ]; then | ||
sweep_adni | ||
else | ||
echo "Invalid argument. Usage: $0 [ppmi|adni]. Got $dataset instead" | ||
exit 1 | ||
fi |