diff --git a/didactic/config/experiment/cardinal/multimodal-xformer-finetune.yaml b/didactic/config/experiment/cardinal/multimodal-xformer-finetune.yaml index 2595ed0a..26196e27 100644 --- a/didactic/config/experiment/cardinal/multimodal-xformer-finetune.yaml +++ b/didactic/config/experiment/cardinal/multimodal-xformer-finetune.yaml @@ -12,6 +12,7 @@ excluded_clinical_attrs: ${oc.dict.keys:task.predict_losses} task: predict_losses: ??? + ordinal_mode: True contrastive_loss: _target_: vital.metrics.train.metric.NTXent contrastive_loss_weight: 0 @@ -28,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/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/finetune/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} sweep: dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/finetune - subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} diff --git a/didactic/config/experiment/cardinal/multimodal-xformer-head.yaml b/didactic/config/experiment/cardinal/multimodal-xformer-head.yaml index 3532b60b..14e185b6 100644 --- a/didactic/config/experiment/cardinal/multimodal-xformer-head.yaml +++ b/didactic/config/experiment/cardinal/multimodal-xformer-head.yaml @@ -12,6 +12,7 @@ excluded_clinical_attrs: ${oc.dict.keys:task.predict_losses} task: predict_losses: ??? + ordinal_mode: True callbacks: transformer_encoder_freeze: @@ -24,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/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/head/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} sweep: dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/head - subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} diff --git a/didactic/config/experiment/cardinal/multimodal-xformer-scratch.yaml b/didactic/config/experiment/cardinal/multimodal-xformer-scratch.yaml index 434dbfee..0c15aa43 100644 --- a/didactic/config/experiment/cardinal/multimodal-xformer-scratch.yaml +++ b/didactic/config/experiment/cardinal/multimodal-xformer-scratch.yaml @@ -10,6 +10,7 @@ excluded_clinical_attrs: ${oc.dict.keys:task.predict_losses} task: predict_losses: ??? + ordinal_mode: True contrastive_loss: _target_: vital.metrics.train.metric.NTXent contrastive_loss_weight: 0 @@ -17,7 +18,7 @@ task: hydra: run: - dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} sweep: dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/scratch - subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} diff --git a/didactic/config/experiment/cardinal/multimodal-xformer.yaml b/didactic/config/experiment/cardinal/multimodal-xformer.yaml index 97ea57a0..faf68836 100644 --- a/didactic/config/experiment/cardinal/multimodal-xformer.yaml +++ b/didactic/config/experiment/cardinal/multimodal-xformer.yaml @@ -122,7 +122,7 @@ callbacks: _target_: pytorch_lightning.callbacks.LearningRateFinder -experiment_dirname: encoder=${hydra:runtime.choices.task/model/encoder}/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.num_layers},nhead=${task.model.encoder.encoder_layer.nhead},dropout=${task.model.encoder.encoder_layer.dropout}/mtr_p=${task.mtr_p},mt_by_attr=${task.mt_by_attr} +experiment_dirname: 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} hydra: job: config: @@ -162,3 +162,7 @@ hydra: - task.model.encoder.encoder_layer.nhead - task.model.encoder.encoder_layer.dim_feedforward - task.model.encoder.encoder_layer.dropout + + - task.ordinal_mode + - task.model.ordinal_head.backbone_distribution + - task.model.ordinal_head.tau_mode diff --git a/didactic/config/experiment/cardinal/xtab-finetune.yaml b/didactic/config/experiment/cardinal/xtab-finetune.yaml index 14bf33c4..be05d577 100644 --- a/didactic/config/experiment/cardinal/xtab-finetune.yaml +++ b/didactic/config/experiment/cardinal/xtab-finetune.yaml @@ -11,6 +11,7 @@ excluded_clinical_attrs: ${oc.dict.keys:task.predict_losses} task: predict_losses: ??? + ordinal_mode: True contrastive_loss: _target_: vital.metrics.train.metric.NTXent contrastive_loss_weight: 0 @@ -34,10 +35,9 @@ 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/encoder}/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} hydra: run: - dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune/${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname} sweep: dir: ${oc.env:CARDIAC_MULTIMODAL_REPR_PATH}/xtab-finetune - subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/${hydra.job.override_dirname} + subdir: ${experiment_dirname}/targets=${oc.dict.keys:task.predict_losses}/ordinal_mode=${task.ordinal_mode},distribution=${oc.select:task.model.ordinal_head.distribution,null},tau_mode=${oc.select:task.model.ordinal_head.tau_mode,null}/${hydra.job.override_dirname}