std1.0.0-beta-7 SafeC docs

std :: ml::autoencoder

Struct std::Vae

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

struct Vae {
    struct Mlp enc;
    struct Mlp muHead;
    struct Mlp logvarHead;
    struct Mlp dec;
    struct VaeConfig cfg;
    struct Rng rng;
    float lastRecon;
    float lastKl;
}

Fields

§struct Mlp encsource

trunk: x (+ label) -> hidden

§struct Mlp muHeadsource

hidden -> latent

§struct Mlp logvarHeadsource

hidden -> latent

§struct Mlp decsource

z (+ label) -> x

§struct Rng rngsource
§float lastReconsource
§float lastKlsource

Methods

§&FloatTensor encode(const &FloatTensor x, const &FloatTensor y)source · definition

mu of q(z|x) (y: class indices, read only by a CVAE).

§&FloatTensor decode(const &FloatTensor z, const &FloatTensor y)source · definition
§&FloatTensor reconstruct(const &FloatTensor x, const &FloatTensor y)source · definition

decode(mu)

§&FloatTensor sample(unsigned long n, ?&FloatTensor labels)source · definition

n new samples from the prior; 'labels' (n class indices) for a CVAE, null for an unconditional VAE.

§void collect_params(&Vec<&FloatTensor> out) constsource · definition

Parameterized (module.h).

§void collect_state(&Vec<&FloatTensor> out) constsource · definition
§void drop()source · definition
§void free() consumesource · definition

= drop()

§static struct Vae new(unsigned long inDim, const &VaeConfig cfg)source · definition