An encoder is the part that converts input data into feature vectors (latent representations) that are easy to use in later processing. It replaces inputs of varying form and size, such as images, text, audio and time series, with sequences of numbers in which items with similar meanings take similar values.
This is similar to reading a long document and summarizing the key points in a memo. The memo (the latent representation) keeps only the information from the original document that later tasks need. That memo can then be used to rewrite the original document (reconstruction), translate it into another language (translation), or classify its content.
The latent representation output by an encoder is also called an embedding or features. The part that receives the latent representation and produces the output falls into two types depending on the task.
- Decoder: Produces data of the same kind as the input (images, text, etc.) from the latent representation. Used for reconstruction, generation and translation.
- Head: Produces answers such as classes or numbers from the latent representation. It is usually a few fully connected layers. Used for classification, regression and forecasting.

