liveBook · Manning

Encoder-decoder architecture

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

A neural model that transforms an input sequence into an output sequence, typically allowing the two sequences to have different lengths.

A sequence-to-sequence model maps an ordered input sequence to an output sequence. In combinatorial problems such as sorting or the travelling salesperson problem, the output elements come from the input, so their possible categories depend on input length. section 11.3.3

Pointer networks address this challenge by using attention to select input items for the output. Unlike conventional attention, which helps generate an output element, this mechanism points to an input element. section 11.3.3

Selecting convex-hull points

Given points labeled [1, 2, 3, 4], a pointer network can estimate an output sequence such as [1, 4, 2]. The output can contain fewer items than the input. section 11.3.3

Table 11.2 Sequential ML (view table figure)

Task

Example

One-to-one

Image classification. We provide a single image as input, and the model outputs the classification or category, like “dog” or “cat,” as a single output.

One-to-many

Image captioning. We input a single image into the model, and it generates a sequence of words describing that image.

Many-to-one

Sentiment analysis. We input a sequence of words (like a sentence or a tweet), and the model outputs a single sentiment score (like “positive," “negative,” or “neutral”).

Many-to-many (type 1)

Sequence input and sequence output, like in the case of named entity recognition (NER). We input a sentence (a sequence of words), and the model outputs the recognized entity, such as a person, organization, location, etc.

Many-to-many (type 2), known as a synchronized sequence model

Synced sequence input and output. The model takes a sequence of inputs but doesn’t output anything until the entire sequence has been read. Then it outputs a sequence. An example of this is video classification, where the model takes a sequence of video frames as input and then outputs a sequence of labels for those frames.

Compare sequence tasks by whether they map one item or many to their outputs. section 11.3.3

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines sequence-to-sequence modeling and pointer selection, but does not detail network internals.
Examples
Uses convex-hull point selection and mentions travelling-salesperson, sorting, and named-entity-recognition tasks.
What you can do after
Understand how pointer networks select input items when output categories depend on input length.
How it connects
Connects recurrent neural networks, long short-term memory, attention, pointer networks, and combinatorial optimization.

Also explained in

Compare how 10 books explain encoder-decoder architecture →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.