Reconstruction loss

Reshape and get the original image by using the following code:

original_image = tf.reshape(x, shape=(batch_size, -1))

Compute the mean of the squared difference between the reconstructed and the original image:

squared = tf.square(reconstructed_image - original_image)

Compute the reconstruction loss:

reconstruction_loss = tf.reduce_mean(squared) 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset