Learn Before
Concept
Encoder Transformation to a Fixed-Shape State
In an encoder–decoder architecture, the encoder is designed to process input data that may vary in size. It accepts a variable-length sequence as its input and mathematically transforms it into an encoded state that has a fixed, predetermined shape. This fixed-shape state acts as a compressed summary containing the crucial context from the original sequence. In a common approach, the encoder uses an RNN to compute hidden states for all time steps and then derives the context variable through a customized function : . A simple choice for is to set , using the final hidden state as the complete context.
0
1
Updated 2026-05-14
Tags
D2L
Dive into Deep Learning @ D2L