All models

SpatioTemporalAttention

The spatio-temporal attention block of GMAN: spatial and temporal attention joined by gated fusion.

Graphs and geometry · 161 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (20 KB)

Open in a new tab

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.

At a glance

Parameters
76K
Operations
161
Framework
PyTorch
Recurrent
No
Published
AAAI 2020
Cited by
1,808 (as of 20 October 2026)
Authors
Chuanpan Zheng, Xiaoliang Fan, Cheng Wang, Jianzhong Qi
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m2876
Graph hash
c63ef0afeb8c1790ebd4cdc47703c9fc8bda285098a8dcfcabe60d975abf86f7
Skeleton hash
5a41469242d08d880ac6348d80fdee99be86716493641dc28c4f4e46629e18f0
Architecture hash
63d018a7bb5f8fddfc0cd40c0cf2b522e463ff94e984bf84f99b9455e07a9a65
Diagram SHA-256
b86f200414b76fd7b812e22b85a636585d4befc379bb7fa8ac7b1661108c643a
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is the spatio-temporal attention block (ST-Attention block) of GMAN, a graph multi-attention network that predicts traffic conditions for time steps ahead at different locations on a road network graph. In GMAN, both the encoder and the decoder are composed of a stack of these blocks. A separate transform attention layer sits between the encoder and the decoder and is not part of the block.

The block includes a spatial attention, a temporal attention and a gated fusion. The spatial attention dynamically assigns different weights to different vertices, such as traffic sensors, at different time steps. The temporal attention concatenates the hidden state with a spatio-temporal embedding and uses multi-head attention to score how relevant one time step is to another. The gated fusion then combines the two outputs, controlling the flow of spatial and temporal dependencies at each vertex and time step.

On its traffic volume and traffic speed prediction tasks, the paper reports up to 4% improvement in MAE over the methods it compared against in 1 hour ahead prediction. The paper tuned three hyperparameters and found the best validation performance with 3 blocks, 8 attention heads and 8 dimensions per head, which gives 64 channels per layer.

Key idea. GMAN builds its encoder and decoder from ST-Attention blocks, each composed of spatial and temporal attention mechanisms with gated fusion.

  • gman
  • graph multi-attention network
  • spatio-temporal attention
  • st-attention block
  • traffic prediction
  • traffic forecasting
  • spatial attention
  • temporal attention
  • gated fusion

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zheng2019gmangraphmultiattentionnetwork,
      title={GMAN: A Graph Multi-Attention Network for Traffic Prediction}, 
      author={Chuanpan Zheng and Xiaoliang Fan and Cheng Wang and Jianzhong Qi},
      year={2019},
      eprint={1911.08415},
      archivePrefix={arXiv},
      primaryClass={eess.SP},
      url={https://arxiv.org/abs/1911.08415}, 
}