All models

GraphConstructor

The graph learning layer of MTGNN: a sparse, one-directional adjacency learned from node embeddings.

Time series · 27 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 (29 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
19.8K
Operations
27
Framework
PyTorch
Recurrent
No
Published
ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD) (arXiv 2020)
Cited by
2,137 (as of 20 October 2026)
Authors
Zonghan Wu, Shirui Pan, Guodong Long and others
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
m1233
Graph hash
cefc82e1d008b0f39a26c4a1bd22b6256b47dd39a65291541909d80273f01b5b
Skeleton hash
6c3618d938c4eed0a8dfae35c1a575c4b489017262eb66fe44e8a6aedf640a81
Architecture hash
4b7030aea24ff96ab19dbee9fcc0d8e3f9d272261bfcb25680e5001d81a46bff
Diagram SHA-256
7ac2fcbd0fc3b8a46ecc24c59b35f7c14148d0584c5b28c215de49eece569446
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 is one layer of MTGNN, not a forecaster: the graph learning layer that produces a sparse adjacency matrix among the variables of a multivariate time series. MTGNN's premise is that graph neural networks need a graph to propagate over, and multivariate time series usually do not come with one. The layer holds two sets of randomly initialized node embeddings that are learned during training, each passed through its own linear map and a tanh. The adjacency is the rectified difference of the two cross-products, so if one direction of a pair is positive the reverse direction is zero: the learned relations are one-directional. Each row is then sparsified by keeping only the top-k entries and zeroing the rest.

The version here is the authors' own graph constructor module, sized for METR-LA with 207 nodes, so its output is a 207 by 207 adjacency. The paper's settings, also used here, are a node embedding dimension of 40 and a saturation rate of 3 for the tanh. In the full MTGNN that adjacency feeds the graph convolution modules, which are trained jointly with the temporal convolutions end to end.

In the paper's ablation on METR-LA, this uni-directed learned graph gave the lowest mean MAE, RMSE and MAPE among the compared ways of building the adjacency, including the predefined road-distance graph. The full model, the paper reports, outperformed the baselines on 3 of its 4 benchmark datasets and matched other approaches on two traffic datasets that come with a graph.

Key idea. MTGNN's graph learning layer learns a sparse, one-directional adjacency among time series variables from node embeddings, letting graph neural networks forecast series with no given graph.

  • mtgnn
  • graph constructor
  • graph learning layer
  • adaptive adjacency
  • graph structure learning
  • multivariate time series
  • learned graph
  • metr-la
  • node embeddings
  • pytorch geometric temporal

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

Cite the paper

@misc{wu2020connectingdotsmultivariatetime,
      title={Connecting the Dots: Multivariate Time Series Forecasting with Graph Neural Networks}, 
      author={Zonghan Wu and Shirui Pan and Guodong Long and Jing Jiang and Xiaojun Chang and Chengqi Zhang},
      year={2020},
      eprint={2005.11650},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2005.11650}, 
}