Skip to Content
Hands-On Convolutional Neural Networks with TensorFlow
book

Hands-On Convolutional Neural Networks with TensorFlow

by Iffat Zafar, Giounona Tzanidou, Richard Burton, Nimesh Patel, Leonardo Araujo
August 2018
Intermediate to advanced
272 pages
7h 2m
English
Packt Publishing
Content preview from Hands-On Convolutional Neural Networks with TensorFlow

Generating new data

After the VAE model is trained, we can chop off its decoder part and use this as a generator to generate new data for us. It will work by feeding it new latent vectors that come from a unit Gaussian distribution.

We present in TensorFlow the code responsible for build this generating VAE graph as follows:

class VAE_CNN_GEN(object): def __init__(self, img_size=28, latent_size=20): self.__x = tf.placeholder(tf.float32, shape=[None, latent_size], name='LATENT_IN') with tf.name_scope('DECODER'): # Linear layer self.__z_develop = tf.layers.dense(inputs=self.__x, units=7 * 7 * 32, activation=None, name="z_matrix") self.__z_develop_act = tf.nn.relu(tf.reshape(self.__z_develop, [tf.shape(self.__x)[0], 7, 7, 32])) # DECONV1 self.__conv_t2_out_act ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Vaibhav Verdhan

Publisher Resources

ISBN: 9781789130331Supplemental Content