From 67e70962afe475903338254a1403354eb7f1addb Mon Sep 17 00:00:00 2001 From: Nathan Painchaud Date: Wed, 1 Nov 2023 19:49:45 +0100 Subject: [PATCH] Extract configuration of img/clin attrs to use in its own config group This also allows us to further simplify the Hydra dirname scheme --- .../cardinal/multimodal-xformer.yaml | 6 +++--- didactic/config/task/data/all-clinical.yaml | 5 +++++ didactic/config/task/data/all.yaml | 5 +++++ didactic/config/task/data/top-13+img.yaml | 18 ++++++++++++++++++ didactic/config/task/data/top-13.yaml | 18 ++++++++++++++++++ 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 didactic/config/task/data/all-clinical.yaml create mode 100644 didactic/config/task/data/all.yaml create mode 100644 didactic/config/task/data/top-13+img.yaml create mode 100644 didactic/config/task/data/top-13.yaml diff --git a/didactic/config/experiment/cardinal/multimodal-xformer.yaml b/didactic/config/experiment/cardinal/multimodal-xformer.yaml index faf68836..060ecbed 100644 --- a/didactic/config/experiment/cardinal/multimodal-xformer.yaml +++ b/didactic/config/experiment/cardinal/multimodal-xformer.yaml @@ -1,6 +1,7 @@ # @package _global_ defaults: + - /task/data: all - /task/img_tokenizer/model: null - /task/model/encoder: ??? - /task/model/contrastive_head: mlp @@ -101,8 +102,6 @@ n_img_attrs: ${op.mul:${builtin.len:${task.views}},${builtin.len:${task.img_attr task: _target_: didactic.tasks.cardiac_multimodal_representation.CardiacMultimodalRepresentationTask embed_dim: 8 - clinical_attrs: ${list.remove:${data.process_patient_kwargs.clinical_attributes},${excluded_clinical_attrs}} - img_attrs: ${data.process_patient_kwargs.image_attributes} views: ${data.patients_kwargs.views} latent_token: True sequential_pooling: False @@ -122,7 +121,7 @@ callbacks: _target_: pytorch_lightning.callbacks.LearningRateFinder -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} +experiment_dirname: data=${hydra:runtime.choices.task/data}/contrastive=${oc.select:task.contrastive_loss_weight,0}/time_series_tokenizer=${hydra:runtime.choices.task/img_tokenizer/model} hydra: job: config: @@ -146,6 +145,7 @@ hydra: - data - excluded_clinical_attrs + - task/data - task.clinical_attrs - task.img_attrs - task.predict_losses diff --git a/didactic/config/task/data/all-clinical.yaml b/didactic/config/task/data/all-clinical.yaml new file mode 100644 index 00000000..3253b523 --- /dev/null +++ b/didactic/config/task/data/all-clinical.yaml @@ -0,0 +1,5 @@ +# @package _global_ + +task: + clinical_attrs: ${list.remove:${data.process_patient_kwargs.clinical_attributes},${excluded_clinical_attrs}} + img_attrs: [] diff --git a/didactic/config/task/data/all.yaml b/didactic/config/task/data/all.yaml new file mode 100644 index 00000000..19642a2e --- /dev/null +++ b/didactic/config/task/data/all.yaml @@ -0,0 +1,5 @@ +# @package _global_ + +task: + clinical_attrs: ${list.remove:${data.process_patient_kwargs.clinical_attributes},${excluded_clinical_attrs}} + img_attrs: ${data.process_patient_kwargs.image_attributes} diff --git a/didactic/config/task/data/top-13+img.yaml b/didactic/config/task/data/top-13+img.yaml new file mode 100644 index 00000000..4268529f --- /dev/null +++ b/didactic/config/task/data/top-13+img.yaml @@ -0,0 +1,18 @@ +# @package _global_ + +task: + clinical_attrs: + - sbp_tte + - pp_tte + - age + - diastolic_dysfunction_param_sum + - pw_d + - lvm_ind + - e_e_prime_ratio + - gfr + - lateral_e_prime + - septal_e_prime + - a_velocity + - ddd + - la_volume + img_attrs: ${data.process_patient_kwargs.image_attributes} diff --git a/didactic/config/task/data/top-13.yaml b/didactic/config/task/data/top-13.yaml new file mode 100644 index 00000000..39e34192 --- /dev/null +++ b/didactic/config/task/data/top-13.yaml @@ -0,0 +1,18 @@ +# @package _global_ + +task: + clinical_attrs: + - sbp_tte + - pp_tte + - age + - diastolic_dysfunction_param_sum + - pw_d + - lvm_ind + - e_e_prime_ratio + - gfr + - lateral_e_prime + - septal_e_prime + - a_velocity + - ddd + - la_volume + img_attrs: []