Quickly understand latent code potential encoding in deep learning

This article makes a lot of references to the English literature Understanding Latent Space in Machine Learning , and gives some personal understanding. The original intention is to record, and the second is to share.

1. What is Latent Coding?

In fact, exposure to deep learning or machine learning should count as exposure to latent coding. My understanding of latent coding is a kind of dimensionality reduction or compression , which aims to express the essence of data with less information.

encoder-decoder architecture
The above picture is a simple encoder-decoder architecture. If the entire network is regarded as a vase, the thinnest part is called the bottleneck. We know that compression is generally lossy, and this is no exception, but if the loss is noise or useless information, it is our favorite (so that the purpose of information compression can be achieved)

After being compressed by the encoder, the more important thing is to restore. We should think that only those that can be restored are successfully compressed. Then we can think that this latent space representation really expresses the most critical information in the input image.

2. What is latent space?

My personal understanding is that latent space and latent encoding mean the same thing, and encoding -> space is intuitive. For example, a 3x1 encoding can be drawn as a point in three-dimensional space.

3. Further understand similar latent coding similarities

First define what is the same kind, chairs and chairs are the same kind, dogs and dogs are the same kind. As shown in the figure, if a complete 3D representation is used to represent the A chair and the B chair, then they will not be close to each other. At a glance, one can see that one is yellow and the other is black, and the orientation is also different. However, if some "personalized features" are removed and only one class of features is retained, then their points in the latent space are very, very close, such as removing the color. Imagine in space, chair A and chair B will be very close at this time, we think they are very similar.
insert image description here

4. Application of Latent Coding

So, if we perfectly get the potential representation of something, namely latent code (also called latent space or latent space representation), what can we do with it?

Here I have to mention Antoencoders and Generative models.

insert image description here
Autoencoder, as the name suggests, encodes itself. It can be found that the output and input of this network are the same thing. If the output is "determined hero", then we think it is meaningless, but if we observe its process, we know that latent coder passes Decoder The specific implementation is even simpler when you restore yourself. You only need to do a similarity loss between the output and the input, and then backpropagate, and it will slowly look like it.

latent space interpolation

The same kind is similar in space. For example, the vectors of two chairs are [0.1,0.1] and [0.12,0.12]. If these two are fed into the network, the generated chair is of course. If the input is [0.11,0.11] Woolen cloth? And of course the chair, that's interpolation. The figure below shows the effect of interpolation. You can see that the interpolation around the same type is similar but slightly different. The simplest application is to use it as a kind of data augmentation to expand the dataset.

The image below shows the effect of linear interpolation between two chairs.
insert image description here

5 Conclusion

Latent space can represent a certain (class) information with a small amount of data, and it also has more specific applications in fields such as 3D representation.

Guess you like

Origin blog.csdn.net/xiufan1/article/details/128080923