Skip to content

Iterators such as DynamicGraphTemporalSignal use edge_weights interchangeably with edge_attr #279

Open
@lucianocheng

Description

@lucianocheng

Just a heads up that in DynamicGraphTemporalSignal and other iterators, edge_weights maps directly onto edge_attr into torch_geometric.data.Data.

Specifically, in dynamic_graph_temporal_signal.py, a Data object is passed back as a snapshot, where edge_weight (pulled from edge_weights) is passed into the edge_attr parameter of data.Data.

This has some key effects for dealing with snapshots in Pytorch Geometric Temporal:

  1. When inspecting a Data object coming out of a DynamicGraphTemporalSignal iteration, edge_weights will appear in the edge_attr field.
  2. DynamicGraphTemporalSignal accepts a kwargs parameter for snapshots where you can include arbitrary features with a snapshot. If you include a edge_attr field in this kwargs, it will overwrite your edge_weights into the Data object.
  3. edge_weights can hold multiple features per edge, since edge_attr can support a multi-dimensional tensor per edge.

In the documentation, it's unclear in many places whether edge_weights can support multiple features (it can), or how edge_weights maps to edge_attr (it does). I propose we clean up the documentation to clarify this, or rename edge_weights as edge_attr in the code to be consistent with PyG / PyTorch Geometric.

In the meantime, highly recommend inspecting your snapshot torch_geometric.data.Data objects coming out of the iterators (such as DynamicGraphTemporalSignal to understand their shape before training.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions