liveBook · Manning

Reconstruction loss

As explained in Deep Learning with Python, Third Edition

A loss that measures how well a model reproduces its input or a corrupted version of it.

Reconstruction loss measures whether a decoder reproduces the input. In a variational autoencoder, it pushes decoded samples toward the original image while regularization shapes the latent distribution. section 17.1.2

A VAE reconstruction pass

An input image becomes a latent sample and then a reconstructed image: z_mean, z_log_variance = encoder(input_img); z = z_mean + exp(z_log_variance) * epsilon; reconstructed_img = decoder(z). Training uses reconstruction loss to make reconstructed_img match input_img. section 17.1.2

Use this rule of thumb:

  • Reconstruction loss preserves input information; regularization loss encourages a well-rounded latent distribution and reduces overfitting. section 17.1.2
Figure 17.3 An autoencoder: mapping an input x to a compressed representation and then decoding it back as x'
autoencoder

The autoencoder diagram shows the target relationship: encode an input x, then decode it as a matching x'. section 17.1.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains its training role and contrasts it with regularization, but does not specify a reconstruction formula.
Examples
Uses an encoder-decoder image pipeline and an autoencoder diagram mapping x to a reconstructed x'.
What you can do after
Builds a VAE training objective that compares decoded images with their original inputs.
How it connects
Connects reconstruction loss to variational autoencoders, autoencoders, latent space, and regularization loss.

Also explained in

Compare how 10 books explain reconstruction loss →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.