std1.0.0-beta-7 SafeC docs

std :: ml::autoencoder

Struct std::VqVae

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

struct VqVae {
    struct Mlp enc;
    struct Mlp dec;
    &FloatTensor codebook;
    &FloatTensor idle;
    int initialized;
    struct Rng rng;
    struct VqVaeConfig cfg;
    float lastRecon;
    float lastVq;
    float lastPerplexity;
}

Fields

§struct Mlp encsource
§struct Mlp decsource

[codes, latent]

[codes] batches since each code was last used

§int initializedsource

codebook set from encoder outputs yet

§struct Rng rngsource
§float lastReconsource
§float lastVqsource

codebook + commitment terms

§float lastPerplexitysource

exp(entropy) of code use in the last batch

Methods

[m] code indices

§&FloatTensor decode(const &FloatTensor codes)source · definition

indices -> [m, inDim]

§&FloatTensor reconstruct(const &FloatTensor x)source · definition
§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 VqVae new(unsigned long inDim, const &VqVaeConfig cfg)source · definition