An encoder transforms an input into a compact internal representation. In an autoencoder, f_in(x) = z produces a latent representation that a decoder maps back toward x; in sequence-to-sequence models, an encoder RNN maps X = x₁, …, x_T to a summary hidden state. section 7.1 section 11.1
Use the encoder design to control what information the representation preserves:
- Constrain capacity with a bottleneck: progressively reduce layer widths so the network cannot simply copy its input. section 7.2 section 7.1
- Treat symmetry between encoder and decoder as a convenient design choice, not a requirement; the encoder can taper from a large input toward a smaller z. section 7.2
- Relate simple and deep encoders: PCA uses a linear weight matrix W as the encoder, while deeper networks learn more complex functions. section 7.1.1 section 7.2
- Improve robustness by perturbing inputs during training; an encoder with Gaussian-noise or dropout layers learns representations that support denoising. section 7.4.1
Sequence-to-sequence encoder
Feed X into an RNN encoder, then pass its final hidden state h_T to the decoder as h_encoded. This state summarizes the input sequence and supplies context for generating an output sequence Y, which may differ in content and length. section 11.3 section 11.1
Figure 7.2 The process of autoencoding. The input goes through an encoder that produces a new representation of the data z. The representation z can be useful for lots of tasks like clustering, search, and even classification. The decoder attempts to reconstruct the original input x from the encoding z.
Trace how an input becomes z and how the decoder reconstructs it; the representation can support clustering, search, and classification. section 7.1




















