Struct std::ConvVae
struct ConvVae {
struct ConvNet enc;
struct Mlp muHead;
struct Mlp logvarHead;
struct ConvNet dec;
struct VaeConfig cfg;
struct Rng rng;
float lastRecon;
float lastKl;
}Convolutional VAE: linear mu / log sigma^2 heads on the flattened encoder features, the loss of Vae. Reads latent, recon, beta, classes and seed from the config (hidden, hiddenLayers and act describe the nets you built and are ignored). classes > 0 makes it a conditional VAE: the label goes to the encoder as 'classes' extra input channels (one constant plane per class, see tensor_append_label_channels) and to the decoder as a one-hot appended to the code. So for C-channel images the encoder takes C + classes channels, the decoder latent + classes inputs and outputs C channels. 'y' holds the class indices, as for Vae.
Fields
features -> latent
latent (+ label) -> image
Methods
mu
n samples from the prior; 'labels' (n class indices) for a conditional VAE, null otherwise.
Parameterized (module.h).
= drop()