Skip to content

Commit

Permalink
Update naming scheme of custom transformer experiment configs + outpu…
Browse files Browse the repository at this point in the history
…t folders hierarchy
  • Loading branch information
nathanpainchaud committed Oct 24, 2023
1 parent 010960b commit 722549c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_

defaults:
- cardinal/cardiac-multimodal-representation
- cardinal/multimodal-xformer
- /callbacks:
- transformer_encoder_freeze

Expand Down Expand Up @@ -29,7 +29,7 @@ strict: False # Only load weights where they match the defined network, to only

hydra:
run:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/finetune/targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/finetune/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
sweep:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/finetune
subdir: targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_

defaults:
- cardinal/cardiac-multimodal-representation
- cardinal/multimodal-xformer
- /callbacks:
- transformer_encoder_freeze

Expand All @@ -25,7 +25,7 @@ strict: False # Only load weights where they match the defined network, to only

hydra:
run:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/head/targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/head/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
sweep:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/head
subdir: targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @package _global_

defaults:
- cardinal/multimodal-xformer

trainer:
max_epochs: 2500

excluded_clinical_attrs: ???

task:
contrastive_loss:
_target_: vital.metrics.train.metric.NTXent
contrastive_loss_weight: 1
mtr_p: [0.3, 0]

hydra:
run:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/pretrain/${experiment_dirname}/excluded_clinical_attrs=${excluded_clinical_attrs}/${hydra.job.override_dirname}
sweep:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/pretrain
subdir: ${experiment_dirname}/excluded_clinical_attrs=${excluded_clinical_attrs}/${hydra.job.override_dirname}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_

defaults:
- cardinal/cardiac-multimodal-representation
- cardinal/multimodal-xformer

trainer:
max_epochs: 2500
Expand All @@ -18,7 +18,7 @@ task:

hydra:
run:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch/targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
sweep:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch
subdir: targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
8 changes: 4 additions & 4 deletions didactic/config/experiment/cardinal/xtab-finetune.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_

defaults:
- cardinal/cardiac-multimodal-representation
- cardinal/multimodal-xformer
- override /task/model: xtab-ft-transformer

trainer:
Expand Down Expand Up @@ -34,10 +34,10 @@ ckpt: ??? # Make it mandatory to provide a checkpoint
weights_only: True # Only load the weights and ignore the hyperparameters
strict: False # Only load weights where they match the defined network, to only some changes (e.g. heads, etc.)

experiment_dirname: encoder=${hydra:runtime.choices.task/model}/n_clinical_attrs=${builtin.len:${task.clinical_attrs}},n_img_attrs=${op.mul:${builtin.len:${task.views}},${builtin.len:${task.img_attrs}}}/contrastive=${oc.select:task.contrastive_loss_weight,0}/embed_dim=${task.embed_dim},depth=${task.model.encoder.n_blocks},nhead=${task.model.encoder.attention_n_heads},dropout=${task.model.encoder.attention_dropout},${task.model.encoder.ffn_dropout},${task.model.encoder.residual_dropout}/mtr_p=${task.mtr_p},mt_by_attr=${task.mt_by_attr},attrs_dropout=${task.attrs_dropout}
experiment_dirname: encoder=${hydra:runtime.choices.task/model}/img_tokenizer=${hydra:runtime.choices.task/img_tokenizer/model}/n_clinical_attrs=${n_clinical_attrs},n_img_attrs=${n_img_attrs}/contrastive=${oc.select:task.contrastive_loss_weight,0}/embed_dim=${task.embed_dim},depth=${task.model.encoder.n_blocks},nhead=${task.model.encoder.attention_n_heads},dropout=${task.model.encoder.attention_dropout},${task.model.encoder.ffn_dropout},${task.model.encoder.residual_dropout}/mtr_p=${task.mtr_p},mt_by_attr=${task.mt_by_attr},attrs_dropout=${task.attrs_dropout}
hydra:
run:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune/targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}
sweep:
dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune
subdir: targets=${oc.dict.keys:task.predict_losses}/${experiment_dirname}/${hydra.job.override_dirname}
subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname}

0 comments on commit 722549c

Please sign in to comment.