### Gate mechanism for features fusion

There are two kind of spatial features, one is obtained with fixed spatial dependencies while the other is calculated with dynamical dependencies. To fuse the two kind of features, a gate mechanism is adopted. We first learn the gate $g$ as $$g=\text{Sigmoid}(f_s(U^{\mathcal S})+f_g(X^{\mathcal G})+b)$$ where $f_s$ and $f_g$ are fully connected layer and $b$ is the bias term. The final output of spatial transformer is $$Y^{\mathcal S}=gU^{\mathcal S}+(1-g)X^{\mathcal G}$$

### General Dynamical Graph Neural Networks

As we have mentioned above, previous graph convolutional networks include spectral-based and spatial-based models, all rely on predefined graph structure, and can not adapt to input graph signal. Here, we demonstrate the entire spatial transformer can be formulated as a general message passing dynamical graph neural network. Formally, we denote $x_v$ as the input features of node $v$. The whole spatial feature learning process can be rewritten as $$m_v=\sum_{w\in \mathcal V }F(x_v, x_w)$$ $$y_v=G(m_v ,x_v)$$ where $\mathcal V$ is the set of nodes in the traffic network, $F$ is the message-passing function that computes the spatial dependencies and passes message $m$ among nodes (Eq.4$-$Eq5), $G$ is the shared position-wise feed forward network to update the node features as $y$ 