std1.0.0-beta-7 SafeC docs

std :: ml::autoencoder

Struct std::VaeConfig

#include <std/ml/autoencoder.h> source

struct VaeConfig {
    unsigned long hidden;
    unsigned long hiddenLayers;
    unsigned long latent;
    int act;
    int recon;
    float beta;
    unsigned long classes;
    unsigned long seed;
}

Kingma & Welling 2014. The encoder outputs mu and log sigma^2 of a diagonal Gaussian q(z|x); z = mu + sigma * eps (the reparameterization trick) is decoded back. Loss per sample:

recon(x, x') + beta * KL(q(z|x) || N(0, I))

with the reconstruction summed over features. beta = 1 is the VAE, beta > 1 the beta-VAE (Higgins et al. 2017, more disentangled codes); raise beta from 0 over the first epochs for KL warm-up. classes > 0 makes it a conditional VAE (Sohn et al. 2015): the one-hot label is appended to the encoder's and the decoder's inputs.

Fields

§unsigned long hiddensource
§unsigned long hiddenLayerssource

= 1

§unsigned long latentsource
§int actsource
§int reconsource
§float betasource
§unsigned long classessource

0: unconditional

§unsigned long seedsource

Methods

§static struct VaeConfig default(unsigned long latent)source · definition

hidden 256, 1 hidden layer, ReLU, BCE, beta 1, unconditional.