liveBook · Manning

Temporal edge

As explained in Graph Neural Networks in Action

An edge connecting corresponding or related nodes across different time-step layers of a temporal graph.

A temporal edge connects nodes across different timestep layers, turning sequential graph snapshots into one graph. It lets information flow between corresponding nodes and supports predictions about future graph states. section 6.3 section 6.3.1

Construct a temporal graph in a short pipeline:

  • Represent each timestep as a separate graph layer with node features such as location and velocity. section 6.3.1
  • Keep intra-timestep edges for relationships within each layer. section 6.3.1
  • Add temporal edges between corresponding nodes across adjacent layers so temporal dependencies become graph connections. section 6.3.1
  • Mask nodes in the final layer and infer their features from unmasked nodes in earlier layers. section 6.3.1

Pose estimation across three timesteps

For layers t = 0, t = 1, and t = 2, duplicate the within-layer edge structure, shift node indices by the number of nodes per timestep, and reshape the result into one adjacency edge index. Mask t = 2, then use information from t = 0 and t = 1 to predict the missing features. section 6.3.1

Listing 6.6 Constructing the adjacency matrix
       total_timesteps = self.\
window_size + self.mask_size  #1
       edge_index = np.repeat(self.edges[None, :],\
 total_timesteps, axis=0) 

       shift = np.arange(total_timesteps)[:, None, \
None] * num_nodes_per_timestep  #2
       edge_index += shift  #3
       edge_index = edge_index.reshape(2, -1)  #4

Inspect the adjacency-matrix construction that repeats per-timestep edges, applies index shifts, and flattens the temporal graph. section 6.3.1

How Graph Neural Networks in Action covers it

How deep it goes
Builds timestep layers, edge-index shifts, masking, and inference, while deferring VAE-RNN snapshot encoding.
Examples
Demonstrates pose estimation with location and velocity features across adjacent timestep layers and masked future nodes.
What it assumes
Assumes sequential graph snapshots and teaches how to represent them as layers with within-layer and cross-layer edges.
What you can do after
Apply temporal edges in a masked GAT workflow for predicting unknown features at a future timestep.
How it connects
Connects dynamic graph neural networks with intra-timestep edges, graph attention networks, node prediction, and temporal masking.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.