
set_transformer_encoder
228 ops423.2K params
The Set Transformer is an attention-based network whose input is a set, with no dependence on element order.
228 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
The Set Transformer is an attention-based neural network module designed to model interactions among the elements of an input set. It is meant for problems whose solutions do not depend on the order of the elements, so the model should be permutation invariant. Earlier set pooling methods process every element independently before pooling, and the paper argues that some information about interactions between elements is then necessarily discarded.
The model consists of an encoder and a decoder, both of which rely on attention. Plain self-attention over a set has quadratic time complexity, so the paper introduces the Induced Set Attention Block (ISAB). An ISAB holds a small number of trainable vectors called inducing points: these first attend to the input set, and the input set then attends to the result. This reduces the computation time of self-attention from quadratic to linear in the number of elements in the set. In the decoder, Pooling by Multihead Attention (PMA) aggregates features by applying multihead attention on a learnable set of k seed vectors, in place of a dimension-wise average or maximum.
One of the paper's tasks is amortized clustering with a mixture of Gaussians, where four seed vectors are used so that each generates the parameters of a cluster. On that task the paper reports that the Set Transformer with only 16 inducing points showed the best performance, even outperforming the full Set Transformer.
Key idea. The Set Transformer models interactions among set elements with attention in its encoder and decoder, using inducing points to make self-attention linear rather than quadratic in set size.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{lee2019settransformerframeworkattentionbased,
title={Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks},
author={Juho Lee and Yoonho Lee and Jungtaek Kim and Adam R. Kosiorek and Seungjin Choi and Yee Whye Teh},
year={2019},
eprint={1810.00825},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1810.00825},
}