MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / vae

Function vae

fashion-mnist-vae/model.js:155–169  ·  view source on GitHub ↗

* The combined encoder-decoder pipeline. * * @param {tf.Model} encoder * @param {tf.Model} decoder * * @returns {tf.Model} the vae.

(encoder, decoder)

Source from the content-addressed store, hash-verified

153 * @returns {tf.Model} the vae.
154 */
155function vae(encoder, decoder) {
156 const inputs = encoder.inputs;
157 const encoderOutputs = encoder.apply(inputs);
158 const encoded = encoderOutputs[2];
159 const decoderOutput = decoder.apply(encoded);
160 const v = tf.model({
161 inputs: inputs,
162 outputs: [decoderOutput, ...encoderOutputs],
163 name: 'vae_mlp',
164 })
165
166 // console.log('VAE Summary');
167 // v.summary();
168 return v;
169}
170
171/**
172 * The custom loss function for VAE.

Callers 2

model_test.jsFile · 0.85
trainFunction · 0.85

Calls 1

applyMethod · 0.45

Tested by

no test coverage detected