From 7f52ef395178a3ab230993726d3df0a925906c20 Mon Sep 17 00:00:00 2001 From: lisab00 Date: Fri, 25 Aug 2023 14:23:19 +0200 Subject: [PATCH 1/4] update doc --- domainlab/models/model_diva.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/domainlab/models/model_diva.py b/domainlab/models/model_diva.py index 9d4b75beb..d03c0a6ab 100644 --- a/domainlab/models/model_diva.py +++ b/domainlab/models/model_diva.py @@ -10,8 +10,40 @@ def mk_diva(parent_class=VAEXYDClassif): """ - DIVA with arbitrary task loss + Instantiate a domain invariant variational autoencoder (DIVA) with arbitrary task loss. + + Details: + This method is creating a generative model based on a variational autoencoder, which can + reconstruct the input images. Here for, three different encoders with latent variables are + trained, each representing a latent subspace for the domain, class and residual features + information, respectively. The latent subspaces serve for disentangling the respective + sources of variation. To reconstruct the input image, the three latent variables are fed + into a decoder. + Additionally, two classifiers are trained, which predict the domain and the class label. + For more details, see: + Ilse, Maximilian, et al. "Diva: Domain invariant variational autoencoders." + Medical Imaging with Deep Learning. PMLR, 2020. + + Args: + parent_class: Class object determining the task type. Defaults to VAEXYDClassif. + + Returns: + ModelDIVA: model inheriting from parent class. + + Input Parameters: + zd_dim: size of latent space for domain-specific information + zy_dim: size of latent space for class-specific information + zx_dim: size of latent space for residual variance + chain_node_builder: TODO + list_str_y: list of labels + list_d_tr: list of training domains + gamma_d: weighting term for d classifier + gamma_y: weighting term for y classifier + beta_d: weighting term for domain encoder + beta_x: weighting term for residual variation encoder + beta_y: weighting term for class encoder """ + class ModelDIVA(parent_class): """ DIVA From e9ba2e4511eac6fba37d968285214179b5972d3b Mon Sep 17 00:00:00 2001 From: lisab00 Date: Mon, 28 Aug 2023 11:57:04 +0200 Subject: [PATCH 2/4] correct display of doc --- domainlab/models/model_diva.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domainlab/models/model_diva.py b/domainlab/models/model_diva.py index d03c0a6ab..34f73c2c4 100644 --- a/domainlab/models/model_diva.py +++ b/domainlab/models/model_diva.py @@ -22,7 +22,7 @@ def mk_diva(parent_class=VAEXYDClassif): Additionally, two classifiers are trained, which predict the domain and the class label. For more details, see: Ilse, Maximilian, et al. "Diva: Domain invariant variational autoencoders." - Medical Imaging with Deep Learning. PMLR, 2020. + Medical Imaging with Deep Learning. PMLR, 2020. Args: parent_class: Class object determining the task type. Defaults to VAEXYDClassif. From 310b5b8b2d2cf6bd94d1b234459eca148bea75c8 Mon Sep 17 00:00:00 2001 From: lisab00 Date: Mon, 28 Aug 2023 12:04:46 +0200 Subject: [PATCH 3/4] correct display of doc --- domainlab/models/model_diva.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/domainlab/models/model_diva.py b/domainlab/models/model_diva.py index 34f73c2c4..21da73fe0 100644 --- a/domainlab/models/model_diva.py +++ b/domainlab/models/model_diva.py @@ -31,16 +31,16 @@ def mk_diva(parent_class=VAEXYDClassif): ModelDIVA: model inheriting from parent class. Input Parameters: - zd_dim: size of latent space for domain-specific information - zy_dim: size of latent space for class-specific information - zx_dim: size of latent space for residual variance - chain_node_builder: TODO - list_str_y: list of labels - list_d_tr: list of training domains - gamma_d: weighting term for d classifier - gamma_y: weighting term for y classifier - beta_d: weighting term for domain encoder - beta_x: weighting term for residual variation encoder + zd_dim: size of latent space for domain-specific information, + zy_dim: size of latent space for class-specific information, + zx_dim: size of latent space for residual variance, + chain_node_builder: TODO, + list_str_y: list of labels, + list_d_tr: list of training domains, + gamma_d: weighting term for d classifier, + gamma_y: weighting term for y classifier, + beta_d: weighting term for domain encoder, + beta_x: weighting term for residual variation encoder, beta_y: weighting term for class encoder """ From 170377c9932920f26ed433157f0fad50701c7fa0 Mon Sep 17 00:00:00 2001 From: lisab00 Date: Mon, 11 Sep 2023 15:38:56 +0200 Subject: [PATCH 4/4] insert link, update doc --- domainlab/models/model_diva.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/domainlab/models/model_diva.py b/domainlab/models/model_diva.py index 21da73fe0..94c2c1363 100644 --- a/domainlab/models/model_diva.py +++ b/domainlab/models/model_diva.py @@ -34,7 +34,9 @@ def mk_diva(parent_class=VAEXYDClassif): zd_dim: size of latent space for domain-specific information, zy_dim: size of latent space for class-specific information, zx_dim: size of latent space for residual variance, - chain_node_builder: TODO, + chain_node_builder: creates the neural network specified by the user; object of the class + "VAEChainNodeGetter" (see domainlab/compos/vae/utils_request_chain_builder.py) + being initialized by entering a user request, list_str_y: list of labels, list_d_tr: list of training domains, gamma_d: weighting term for d classifier, @@ -42,6 +44,10 @@ def mk_diva(parent_class=VAEXYDClassif): beta_d: weighting term for domain encoder, beta_x: weighting term for residual variation encoder, beta_y: weighting term for class encoder + + Usage: + For a concrete example, see: + https://github.com/marrlab/DomainLab/blob/master/tests/test_mk_exp_diva.py """ class ModelDIVA(parent_class):