Year: 2018

Abstract:
We present a soft, spatial, sequential, top-down attention model (S3TA). This model uses a soft attention mechanism to bottleneck its view of the input. A recurrent core is used to generate query vectors, which actively select information from the input by correlating the query with inputand space-dependent key maps at different spatial locations. We demonstrate the power and interpretabilty of this model under two settings. First, we build an agent which uses this attention model in RL environments and show that we can achieve performance competitive with state-of-the-art models while producing attention maps that elucidate some of the strategies used to solve the task. Second, we use this model in supervised learning tasks and show that it also achieves competitive performance and provides interpretable attention maps that show some of the underlying logic in the model’s decision making.

heading: 1 INTRODUCTION
text: Traditional RL agents and image classifiers rely on some combination of convolutional and fully connected components to gradually process input information and arrive at a set of policy or class logits. This sort of architecture is very effective, but does not lend itself to easy understanding of how decisions are made, what information is used and why mistakes are made. Previous efforts to visualize deep RL agents (Greydanus et al. (2017); Zahavy et al. (2016); Wang et al. (2015)) focus on generating saliency maps to understand the magnitude of policy changes as a function of a perturbation of the input. This can uncover some of the “attended” regions, but may be difficult to interpret. For example, it can’t reveal certain types of behavior when the agent makes decisions based on components absent from a frame. Our mechanism provides a more direct interpretation by making the attention a core part of the network.
In this work we present a soft, spatial, sequential and top-down attention model (S3TA, pronounced SETA). This model enables us to build agents and classifiers that actively select important, taskrelevant information from visual inputs by sequentially querying and receiving compressed querydependent summaries to generate appropriate outputs. To do this, the model generates attention maps, which can uncover some of underlying decision process used to solve the task. By observing and analyzing the resulting attention maps we can make educated guesses at how the system solves a task and where and why it might be failing. In the RL domain, we observe that the attention focuses on the key components of each level: tracking the region ahead of the player, focusing on enemies and important moving objects. In supervised learning, we observed that the attention sequentially focuses on different portions of the input to build up confidence in a classification or resolve ambiguity between different class labels. We also find that our model maintains competitive performance on both learning paradigms while providing interpretability.

heading: 2 MODEL
text: Our model, outlined in Figure 1, queries a large input tensor through an attention mechanism and uses the returned compressed answer (a low dimensional summary of the input) to produce its output. We refer to this full query-answer system as an attention head. Our system can implement multiple attention heads by producing multiple queries and receiving multiple answers.
An observation X ∈ RH×W×C at time t (here an RGB frame of height H and width W ) is passed through a “vision core”. The vision core is a multi-layer convolutional network visθ followed by a recurrent layer with state svis(t) such as a ConvLSTM (Shi et al. (2015)), which produces an output tensor Ovis ∈ Rh×w×c: Ovis, svis(t) = visθ(X(t), svis(t− 1)) (1) The vision core output is then split along the channel dimension into two tensors: the “Keys” tensor K ∈ Rh×w×Ck and the “Values” tensor V ∈ Rh×w×Cv , with c = CV + CK . To the keys and values tensors we concatenate a spatial basis — a fixed tensor S ∈ Rh×w×CS which encodes spatial locations (see below for details).
A recurrent neural network (RNN) with parameters φ produces N queries, one for each attention head. The RNN sends its state sRNN from the previous time step t− 1 into a “Query Network”. The query network Qψ is a multi-layer perceptron (MLP) with parameters ψ whose output is reshaped into N query vectors qn of size Ck + CS such that they match the channel dimension of K:
q1... qN = Qψ(sRNN(t− 1)) (2)
Similar to Vaswani et al. (2017), we take the inner product between each query vector qn and all spatial locations in the keys tensor K to form the n-th attention logits map Ãn ∈ Rh×w:
Ãni,j = ∑ c qnc Ki,j,c (3)
where K ∈ Rh×w×Ck+CS is the concatenation along the channel dimension of K and S. We then take the spatial softmax to form the final normalized attention map An:
Ani,j = exp(Ãni,j)∑ i,j exp(Ã n i,j)
(4)
Each attention map An is broadcast along the channel dimension of the values tensor V, pointwise multiplied with it and then summed across space to produce the n-th answer vector an ∈ R1×1×Cv+Cs :
anc = ∑ i,j Ani,jVi,j,c (5)
where V ∈ Rh×w×Cv+CS is the concatenation along the channel dimension of V and S Finally, the N answer vectors an, and the N query form the input to the RNN core to produce the next RNN state sRNN(t) and output o(t) for this time step:
o(t), sRNN(t) = RNNφ(a1, ..., an, q1, ..., qn, sRNN(t− 1)) (6)
The exact details for each of the networks, outputs and states are given in Section 4 and the Appendix.
It is important to emphasize several points about the proposed model. First, the model is fully differentiable due to the use of soft-attention and can be trained using back-propagation. Second, the query vectors are a function of the RNN core state alone and not the observation — this allows for a “top-down” mechanism where the RNN can actively query the input for task-relevant information rather than having to filter out large amounts of information. Third, the spatial sum (equation 5) is a severe spatial bottleneck, which forces the system to make the attention maps in such a way that information is not “blurred” out during summation.
The summation of the values tensor of shape h×w×Cv to an answer of shape 1×1×Cv is invariant to permutation of spatial position, which emphasizes the need for the spatial basis. Due to the spatial structure being lost during the spatial summation, the only way the RNN core can know and reason about spatial positions is by using the channels coming from the spatial basis 1. We postulate that the query and answer structure can have different “modes” — the system can ask “where” (“what”) something is by sending out a query with zeros in the spatial channels of the query and non-zeros in the channels corresponding to the keys (which are input dependent). It can then read the answer from the spatial channels, localizing the object of interest. Conversely it can ask “what is in this
1The vision core might have some ability to produce information regarding absolute spatial positioning, but due to its convolutional structure it is limited.
particular location” by zeroing out the content channels of the query and putting information on the spatial channels, reading the content channels of the answer and ignoring the spatial channels. This is not a dichotomy as the two can be mixed (e.g. “find enemies in the top left corner”), but it does point to an interesting “what” and “where” separation, which we discuss in Section 4.1.5.

heading: 2.1 THE SPATIAL BASIS
text: The spatial basis S ∈ Rh×w×CS such that the channels at each location i, j encode information about the spatial position. Adding this information into the values of the tensor allows some spatial information to be maintained after the spatial summation (equation 5) removes the structural information. Following Vaswani et al. (2017) and Parmar et al. (2018) we use a Fourier basis type of representation. Each channel (u, v) of S is an outer product of two Fourier basis vectors. We use both odd and even basis functions with several frequencies. For example, with two even functions one channel of S with spatial frequencies u and v would be:
Si,j,(u,v) = cos(πui/h) cos(πvj/w) (7)
where u, v are the spatial frequencies in this channel, i, j are spatial locations in the tensor and h,w are correspondingly the height and width of the tensor. We produce all the outer products such that the number of channels in S is (U + V )2 where U and V are the number of spatial frequencies we use for the even and odd components (4 for both throughout this work, so 64 channels in total).
The spatial basis can also be learned as another parameter of the model — while we tested this in some cases we did not observe that this makes a big difference in performance and for brevity this is not done in this work.

heading: 3 RELATED WORK
text: There is a vast literature in recurrent attention models. They have been applied with some success to question-answering datasets (Hermann et al., 2015), text translation (Vaswani et al., 2017; Bahdanau
et al., 2014), video classification and captioning (Shan & Atanasov, 2017; Li et al., 2017), image classification and captioning (Mnih et al., 2014; Chung & Cho, 2018; Fu et al., 2017; Ablavatski et al., 2017; Xiao et al., 2015; Zheng et al., 2017; Wang et al., 2017; Xu et al., 2015; Ba et al., 2014), text classification (Yang et al., 2016; Shen & Lee, 2016), generative models (Parmar et al., 2018; Zhang et al., 2018; Kosiorek et al., 2018), object tracking (Kosiorek et al., 2017), and reinforcement learning (Choi et al., 2017). These attention mechanisms can be grouped by whether they use hard attention (e.g. Mnih et al. (2014); Ba et al. (2014); Malinowski et al. (2018)) or soft attention (e.g. Bahdanau et al. (2014)) and whether they explicitly parameterize an attention window (e.g. Jaderberg et al. (2015); Shan & Atanasov (2017)) or use a weighting mechanism (e.g. Vaswani et al. (2017); Hermann et al. (2015)).
Our work introduces a novel architecture which builds on existing methods. We use a soft key, query, and value type of attention similar to Vaswani et al. (2017) and Parmar et al. (2018), but instead of doing “self”-attention where the queries come from the input (together with the keys and values) we have a different, top-down source for them. This enables the system to be both state/context dependent and input dependent. Furthermore the output of the attention model is highly compressed and has no spatial structure (other than the one preserved using the spatial basis), unlike in “self” attention where each pixel attends to every other pixel and the structure is preserved. Finally, we apply the attention sequentially in time similar to Xu et al. (2015) but with a largely different attention mechanism.
Of existing models, the MAC model (Hudson & Manning, 2018) is the closest to ours. There are several differences between our model and MAC. First, MAC was built to solve CLEVR (Johnson et al., 2017); major parts of it are geared for that dataset. Specifically the “control” unit is built to expect a guiding question for the reasoning process — this may not always exist, such as in the case of RL or classic supervised learning where the systems needs to come up with its own queries to produce the required output. Another difference is the use of a pre-trained ResNet-101 (Wang et al., 2017) as the visual backend; we train the visual core to co-adapt with the top-down mechanism such that it learns to produce useful keys and values for different queries. Finally, MAC does not use a spatial basis. It can still reason about space to some extent through the fully connected layers, but there is not a clear separation between space and content as in our model.

heading: 4 ANALYSIS AND RESULTS

heading: 4.1 REINFORCEMENT LEARNING
text: We use the Arcade Learning Environment (Bellemare et al. (2013b)) to train and test our agent on 57 different Atari games.
For this experiment, the model uses a 3 layer convolutional neural network followed by a convolutional LSTM as the vision core. The RNN is an LSTM that generates a policy π and a baseline function V π; it takes as input the query and answer vectors, the previous reward and a one-hot encoding of the previous action. The query network is a three layer MLP, which takes as input the hidden state h of the LSTM from the previous time step and produces 4 attention queries. See Appendix A.1.1 for a full specification of the network sizes.
We use the Importance Weighted Actor-Learner Architecture (Espeholt et al. (2018)) training architecture to train our agents. We use an actor-critic setup and a VTRACE loss with an RMSProp optimizer (see learning parameters in Appendix A.1.1 for more details).
We compare against two models without bottlenecks to benchmark performance, both using the deeper residual network described in Espeholt et al. (2018). In the Feedforward Baseline, the output of the ResNet is used to directly produce π and V π , while in the LSTM Baseline an LSTM with 256 hidden units is inserted on top of the ResNet. The LSTM also gets as input the previous action and previous reward. We find that our agent is competitive with these state-of-the-art baselines, see Table 1 for benchmark results and Appendix A.1.3 for learning curves and performance on individual levels. Our model provides an attention map which shows the parts of space which are attended to by each attention head. This gives us hints as to what information from the input is used when producing the output. Though these do not necessarily tell the whole story of decision making,
1 All referenced videos can be found at https://sites.google.com/view/s3ta .
they do expose some of the strategies used by the model to solve the different tasks. Here we present some of these strategies and their relationship to the task at hand. Additionally, we analyze the use of the spatial basis vs. keys in the queries as a first step towards understanding the “what” and “where” in the system. We note that all the strategies we discuss here have been observed in more than one game or task; they are reproducible across multiple runs and we postulate they are effective strategies for the solution of the task at hand.
In order to visualize the attention maps we show the original input frame and super-impose the attention map An for each head on it using alpha blending. This means that the bright areas in all images are the ones which are attended to, darker areas are not. We find the range of values to be such that areas which are not attended have weights very close to zero, meaning that little information is “blended” from these areas during the summation in equation 5. A more detailed analysis of the distribution of weights can be seen in Appendix A.2.1.

heading: 4.1.1 THE ROLE OF TOP-DOWN INFLUENCE
text: To test the importance of the top-down queries, we train two additional agents with modified attention mechanisms that do not receive queries from the top-level RNN but are otherwise identical to our agent. The first agent uses the same attention mechanism except that the queries are a learnable bias tensor which does not depend on the LSTM state. The second agent does away with the query mechanism entirely and forms the weights for the attention by computing the L2 norm of each key (similar to a soft version of Malinowski et al. (2018)). Both of these modifications turn the top-down attention into a bottom-up attention, where the vision network has total control over the attention weights.
We train these agents on 7 ATARI games for 2e9 steps and compare the performance to the agent with top-down attention. We see significant drops in performance on 6 of the 7 games. On the remaining game, Seaquest, we see substantially improved performance; the positions of the enemies follow a very specific pattern, so there is little need for sequential decision making in that environment. On these games we see a median human normalized score of 541.1% for the attention agent, 274.7% for the fixed-query agent, and 274.5% for the L2-Norm Key Agent. Mean scores are 975.5%, 615.2% and 561.0% respectively. See Appendix A.1.4 for more details.

heading: 4.1.2 BASIC ATTENTION PATTERNS
text: The most dominant pattern we observe is that the model learns to attend to task-relevant things in the scene. In most ATARI games that usually means that the player is one of the focii of attention, as well as enemies, power-ups and the score itself (which is an important factor in the calculating the value function). Figure 2 (best viewed on screen) shows several examples of these attention maps. We also recommend watching the videos posted online for additional visualizations.

heading: 4.1.3 FORWARD PLANNING/SCANNING
text: In games where there is an element of forward planning and a direct mapping between image space and world space (such as 2D top-down view games) we observe that the model learns to scan through possible paths emanating from the player character and going through possible future trajectories. Figure 3 shows a examples of this in Ms Pacman and Alien — in the both games the model scans through possible paths, making sure there are no enemies or ghosts ahead. We observe that when it does see a ghost, another path is produced or executed in order to avoid it. Again we refer the reader to the videos for a better impression of the dynamics.

heading: 4.1.4 “TRIP WIRES”
text: In many games we observe that the agent learns to place “trip-wires” at strategic points in space such that if something crosses them a specific action is taken. For example, in Space Invaders two such trip wires are following the player ship on both sides such that if a bullet crosses one of them the agent immediately evades them by moving towards the opposite direction. Another example is Breakout where we can see it working in two stages. First the attention is spread out around the general area of the ball, then focuses into a localized line. Once the ball crosses that line the agent moves towards the ball. Figure 4 shows examples of this behavior.

heading: 4.1.5 “WHAT” VS. “WHERE”
text: As discussed in Section 2, each query has two components: one interacts with the keys tensor - which is a function of the input frame and vision core state - and the other interacts with the fixed spatial basis, which encodes locations in space. Since the output of these two parts is added together via an inner product prior to the softmax, we can analyze, for each query and attention map, which part of the query is more responsible for the the attention at each point; we can contrast the “what” from the “where”. For example, during a game a query may be trying to find ghosts or enemies in the scene, in which case the “what” component should dominate as these can reside in many different places. Alternatively, a query could ask about a specific location in the screen (e.g., if it plays a special role in a game), in which case we would expect the “where” part to dominate.
In order to visualize this we color code the relative dominance of each part of the query. When a specific location is more influenced by the contents part, we will color the attention red, and when it is more influenced by the spatial part, we color it blue. Intermediate values will be white. More details can be found in Appendix A.2.
Figure 5 shows several such maps C visualized in Enduro for different query heads. As can be seen, the system uses the two modes to make its decisions, some of the heads are content specific looking for opponent cars. Some are mixed, scanning the horizon for incoming cars and when found, tracking them, and some are location based queries, scanning the area right in front of the player for anything the crosses its path (a “trip-wire” which moves with the player). Examples of this mechanism in action can be seen in the videos online.

heading: 4.1.6 COMPARISON WITH OTHER ATTENTION ANALYSIS METHODS
text: In order to demonstrate that the attention masks are an accurate representation of where the agent is looking in the image, we perform the saliency analysis presented in Greydanus et al. (2017) on both the attention agent and the baseline feedforward agent. This analysis works by introducing a small, local Gaussian blur at a single point in the image and measuring the magnitude of the change in the policy. By measuring this at every pixel in the image, one can form a response map that shows how much the agent relies on the information at every spatial point to form its policy.
To produce these maps we run a trained agent for > 200 unperturbed frames on a level and then repeatedly input the final frame with perturbations at different locations. We form two saliency maps Sπ(i, j) = 0.5||π(X′i,j) − π(X)||2 and SV π (i, j) = 0.5||V π(X ′ i,j) − V π(X)||2 where X ′ i,j is the input frame blurred at point (i, j), π are the softmaxed policy logits and V π is the value function. An example of these saliency maps is shown in Figure 6. We see that the saliency map (in green) corresponds well with the attention map produced by the model and we see that the agent is sensitive to points in its planned trajectory, as we discussed in Section 4.1.3. Furthermore we see the heads specialize in their influence on the model — one clearly affects the policy more where the other affects the value function.
Comparing the attention agent to the baseline agent, we see that the attention agent is sensitive to more focused areas along the possible future trajectory. The baseline agent is more focused on the area immediately in front of the player (for the policy saliency) and on the score, while the attention agent focuses more specifically on the path the agent will follow (for the policy) and on possible future longer term paths (for the value).

heading: 4.2 SUPERVISED LEARNING
text: We test the S3TA mechanism on several image and video classification problems to explore its applicability to other tasks. For image classification, we present the image to the network multiple times, allowing the model to ask new queries of the same image as a function of the previous class logits.

heading: 4.2.1 IMAGENET
text: For ImageNet classification, the model needs substantially more capacity than it does for reinforcement learning. For the vision core, we use a 50-layer ResNet (He et al. (2016)) with no recurrent layer (since there is no motion to process). On top of the ResNet we use a 3-layer MLP to produce
the class logits at each timestep. The output logits are accumulated across time, adding the output of the MLP to the current logits. The Query network is a 4-layer MLP that takes as input the previous (accumulated) logits. The cross-entropy loss is applied to the accumulated class logits at the final timestep.
We ran several baselines, including a standard ResNet 50-layer model. We also create a recurrent version of this model by using a shared, 1-layer MLP to transform each time step’s logits into a 224x224 tensor that is then added to the image at the next time step.
For our model, we find that accuracy initially improves as a function of the number of tiling steps. Our best result is for sequence length of eight timesteps and achieves 74.5% top-1, 91.5% top-5 accuracy. This is an improvement of 0.5% top-1 and 0.4% top-5 over a single ResNet-50 trained with our setup. Our findings are summarized in Table 2.
For ImageNet, S3TA initially attends to low-level edges (mostly around the contour of the object). It will then reduce the class choices under consideration by focusing on high-level features. In the case of dogs, the attention maps first identify that a type of dog is present; correspondingly, the class probabilities will be distributed across possible dog breed choices. The model will then focus on ears, faces, snouts and other distinctive features to tell the specific breed apart, producing peaked logits. An example of this is shown in Figure 7.
The model can alter its classification decisions midway through a sequence, even when it appears to be very confident. When dealing with occlusions, the model will use other image properties to gather relevant class context. An example of this is show in Figure 8. This shows the model is able to perform meaningful sequential computation that significantly alter its classification choices.

heading: 4.2.2 KINETICS
text: Kinetics is an action recognition video dataset where the goal is to classify videos portraying different actions correctly. We ran our model on the September 2018 version of the Kinetics 600 dataset (Carreira et al., 2018). For this model our vision core is a 34 layer ResNet followed by a convolutional LSTM; the rest of the model is identical to the ImageNet model. The videos in the dataset consist of 256 frames, from which we select 32 equally spaced frames to be processed sequentially
by the model. As before, the class logits are accumulated across the sequence and the last one is used as the output. We achieve 58% top-1, 82% top-5 accuracy on this dataset. The state-of-the-art (Carreira et al., 2018) achieves 71.7% top-1 accuracy, 90.4% top-5 accuracy.
In the case of the Kinetics dataset, the attention model often refrains from making a class prediction until a key item appears in the video sequence. The attention maps then focus on this object while it remains in view. For instance, the attention focuses on the musical instrument a person is playing, and the policy logits the narrow down to a few probable choices. If an action sequence is a sport, then the focus is typically on the game ball. Figure 9 shows an example of this behavior.

heading: 5 CONCLUSION
text: We have introduced S3TA, a model for sequential spatial top-down attention. This model learns to query its input for task-relevant information and receive spatially bottlenecked answers. The model performs well on a variety of RL and supervised learning tasks while providing some interpretabilty of its reasoning process.
The attention mechanism produces attention maps which can be used to visualize which parts of the input are attended to. We have seen that the agent is able to make use of a combination of “what” and “where” queries to select both regions and objects within the input depending on the task. In RL agents, we have seen that the agents are able to learn to focus on key features of the inputs, look ahead along short trajectories, and place tripwires to trigger certain behaviors. In supervised models, the model sequentially focuses on important parts of the model to build up confidence in its classification, and will hold off narrowing down its decision until key pieces of information become available. In both the RL and supervised learning paradigms, the model yields interpretable results without sacrificing performance.

heading: A APPENDIX

heading: A.1 ATARI AGENT

heading: A.1.1 AGENT DESCRIPTION
text: Our agent takes in ATARI frames in RGB format (210 × 160 × 3) and processes them through a two layer ConvNet and a ConvLSTM, which produces an output of size 27 × 20 × 128. We split this output along the channel dimension to produce keys of size 27 × 20 × 8 and values of size 27× 20× 120. To each of these we append the same spatial basis of size 27× 20× 64. The query is produced by feeding the state of the LSTM after the previous time step to a three layer MLP. The final layer produces a vector with length 288, which is reshaped into a matrix of size 4× 72 to represent the different attention heads. The queries, keys and values are processed by the mechanism described in Section 2 and produces answers. The queries, answers, previous action, and previous reward are fed into an answer processor, which is a 2 layer MLP. The output of the answer processor is the input to the policy core, which is an LSTM. The output of the policy core is processed through a one layer MLP and the output of that is processed by two different one layer MLPs to produce the policy logits and values estimate. All the sizes are summarizes in Table 3.
We an RMSProp optimizer with = 0.01, momentum of 0, and decay of 0.99. The learning rate is 2e − 4. We use a VTRACE loss with a discount of 0.99 and an entropy cost of 0.01 (described in Espeholt et al. (2018)); we unroll for 50 timesteps and batch 32 trajectories on the learner. We clip rewards to be in the range [−1, 1], and clip gradients to be in the range [−1280, 1280]. Since the framerate of ATARI is high, we send the selected action to the environment 4 times without passing those frames to the agent in order to speedup learning. Parameters were chosen by performing a hyperparameter sweep over 6 levels (battle zone, boxing, enduro, ms pacman, seaquest, star gunner) and choosing the hyperparameter setting that performed the best on the most levels.

heading: A.1.2 MULTI-LEVEL AGENTS
text: We also train an agent on all ATARI levels simultaneously. These agents have distinct actors acting on different levels all feeding trajectories to the same learner. Following Espeholt et al. (2018), we train the agent using population based training (Jaderberg et al. (2017)) with a population size of 16, where we evolve the learning rate, entropy cost, RMSProp , and gradient clipping threshold. We initialize the values to those used for the single level experts, and let the agent train for 2e7 frames before begining evolution. We use the mean capped human normalized score described in Espeholt et al. (2018) to evaluate the relative fitness of each parameter set.

heading: A.1.3 AGENT PERFORMANCE
text: Figure 10 shows the training curves for the experts on 55 ATARI levels (the curves for Freeway and Venture are omitted since they are both constantly 0 for all agents). Table 1 shows the final human-
normalized score achieved on each game by each agent in both the expert and multi-agent regime. As expected, the multi-level agent achieves lower scores on almost all levels than the experts.

heading: A.1.4 TOP-DOWN VERSUS BOTTOM-UP
text: Figure 11 shows the training curves for the Fixed Query Agent and the L2 Norm Keys agent. These agents are all trained on single levels for 2e9 frames. We see that, in 6 of the 7 tested games, the agents without top-down attention perform significantly worse than the agent with top-down attention. Table 5 shows the final scores achieved by each agent on all 7 levels.

heading: A.2 WHAT-WHERE ANALYSIS
text: To form the what-where maps shown in Section 4.1.5, we compute the relative contribution Ci,j for a query q from the content and spatial parts at each location is defined to be:
whati,j = Ck∑ h=1 qhKi,j,h (8)
wherei,j = Cs∑ h=1 qh+CkSi,j,h (9)
Di,j =  −log(10) whati,j − wherei,j < −log(10) whati,j − wherei,j |whati,j − wherei,j | ≤ log(10) log(10) whati,j − wherei,j > log(10)
(10)
Ci,j = Di,jAi,j (11)
where we interpolate between red, white and blue according to the values of C. The intuition is that, at blue (red) points the contribution from the spatial (content) portion to the total weights would be more than 10 times greater than the other portion. We truncate at ±10 because there are often very large differences in the logits, but after the softmax huge differences become irrelevant. We weight by the overall attention weight to focus the map only on channels that actually contribute to the overall weight map.

heading: A.2.1 ATTENTION WEIGHTS DISTRIBUTION
text: Since the sum that forms the attention answers (Equation 5) runs over all space, the peakiness of the attention weights will have a direct impact on how local the information received by the agent is. Figure 12 shows the distribution of attention weights for a single agent position in Ms Pacman and Space Invaders on all four heads. On both games we observe that some of the heads are highly peaked, while others are more diffuse. This indicates that the agent is able to ask very local queries as well as more general queries. It is worth noting that, since the sum preserves the channel structure, it is possible to avoid washing out information even with a general query by distributing information across different channels.

heading: A.3 SUPERVISED LEARNING
text: A.3.1 IMAGENET
Table 6 summarizes the architecture we use to train on ImageNet.
We used a momentum-based optimizer with momentum = 0.9. The learning rate started at 1e − 1 for tile lengths 1 and 4; it set to 1e − 2 for tile length 8. Our batch size was size 1024, and we annealed the learning rate by 0.1 at iterations 1.0e5, 1.5e5, and 1.75e5. We used a learning decay rate of 1e − 4. For training, we applied a data augmentation pipeline involving aspect ratio color distortion as well as flipping the image horizontally. For the sequence length 8 result, we initially train with sequence length 4 for the first 1e5 iterations and then switch to sequence length 8 for the remainder of the training. This greatly improves the training efficiency of the model.
A.3.2 KINETICS 600
Table 7 contains the layer types and sizes we use to train on Kinetics.
As with our ImageNet experiments, we used a momentum-based optimizer with momentum = 0.9. The learning rate was set to 1e − 2 and annealed at iterations 1.5e5, 2.0e5. Our batch size was of size 240.
Our training testing pipelines are very close to those described in (Carreira et al., 2018). However, we don’t pad videos to be of size 251 frames. Rather than employing their sampling procedure, we extract 32 frames in fixed intervals from each video.

Review summaries:
This paper proposed a soft, spatial, sequential, top-down attention model which enable the agent and classifier actively select important, task relative information to generate the appropriate output. Given the observations, the proposed method uses a convLSTM to produce the key and value tensor. Different from multi-head attention, the query vector is generated in a top-down fashion. The authors proposed to augment the spatial feature with Fourier bases which is similar to previous work. The authors verify the proposed method on both reinforcement learning and supervised learning. On reinforcement learning, the proposed method outperformed the feedforward baseline and LSTM baseline. On reinforcement learning task, the proposed method achieves compelling result with more interpretable attention map that shows the model's decision. 

The paper proposes a variant model of existing recurrent attention models. The paper explores the use of query-based attention, spatial basis, and multiple attention modules running in parallel. The effectiveness of the proposed method is demonstrated with various tasks including RL (on Atari games), ImageNet image classification, and action recognition, and shows reasonable performance.