campa.tl.VAEModel
- class VAEModel(**kwargs)[source]
VAE with simple Gaussian prior (trainable with KL loss).
Inherits from
BaseAEModel.Model architecture:
Encoder:
(noise) - conv layers - fc layers - linear layer to latent_dim * 2Latent: split
latent_dimin half, re-sample using Gaussian priorDecoder:
fc_layers - linear (regularized) layer to num_output_channels
Attributes
Default config used in every model.
Model is adversarial if is is conditional and adversarial layers are defined.
Flag set based on
num_conditions.Methods
add_noise(X)Add noise to X.
Create adversarial head:
reverse_gradient - adversarial_layers - num_conditions.Create decoder.
Create encoder.
Create
tf.keras.Model.Apply condition encoder to C.