Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterators such as DynamicGraphTemporalSignal use edge_weights interchangeably with edge_attr #279

Open
lucianocheng opened this issue Aug 22, 2024 · 0 comments

Comments

@lucianocheng
Copy link

lucianocheng commented Aug 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant