An attention-based network adapts computation to each input by scoring hidden items, selecting relevant information, and predicting from the resulting context. A backbone produces hidden states, while separate scoring, attention, and prediction subnetworks handle the non-sequential computation. section 10.3
A typical forward pass:
- Compute a masked context by dividing only by the number of valid items, with a small defensive constant for empty bags. section 10.3
Variable-length digit sets
A modified MNIST dataset samples a variable number of digits, pads shorter sets, and assigns the largest sampled digit as the label. An attention model reaches 0.967 variable-length accuracy in the shown evaluation.
