Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update doc model_diva.py #332

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion domainlab/models/model_diva.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either first merge the new node handler you are implmenting into master, then update this branch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I will first complete the test file and then update the doc again after merge.

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
Expand Down