May 2018
Intermediate to advanced
576 pages
14h 42m
English
Let's continue working with the Fashion MNIST dataset to build a variational autoencoder. As explained, the output of the encoder is now split into two components: the mean and covariance vectors (both with dimensions equal to (width · height)) and the decoder input is obtained by sampling from a normal distribution and projecting the code components. The complete Graph is as follows:
import tensorflow as tfgraph = tf.Graph()with graph.as_default(): input_images = tf.placeholder(tf.float32, shape=(batch_size, width, height, 1)) # Encoder conv_0 = tf.layers.conv2d(inputs=input_images, filters=32, kernel_size=(3, 3), strides=(2, 2), activation=tf.nn.relu, padding='same') conv_1 = tf.layers.conv2d(inputs=conv_0, ...
Read now
Unlock full access