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 h1,,hT\mathbf{h}_1, \ldots, \mathbf{h}_T for all time steps and then derives the context variable c\mathbf{c} through a customized function qq: c=q(h1,,hT)\mathbf{c} = q(\mathbf{h}_1, \ldots, \mathbf{h}_T). A simple choice for qq is to set c=hT\mathbf{c} = \mathbf{h}_T, using the final hidden state as the complete context.

0

1

Updated 2026-05-14

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L