question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to make edge features undirected?

See original GitHub issue

❓ Questions & Help

EDIT: Got the text back, it as in a comment markdown.

Hi!

I’ve realized that the to_undirected(edge_index, num_nodes=None) function does not take the edge features list as an input, only the edge index list. Would the features list not also need to be modified when making a graph undirected?

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jan 20, 2020

No, there is not, but I agree that it would be cool to have 😃

0reactions
rusty1scommented, Jan 7, 2021

This is not really defined in case of edge attributes. If you are sure that reverse edges do not result in duplicated edges, you can simply duplicate your edge_attr matrix: torch.cat([edge_attr, edge_attr], dim=0). In case this does not hold, you need some way to unify duplicate edges into a single representation (doable via torch-scatter). You can pick any method here, e.g., add, mean or max.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make edge features undirected? · Issue #914 - GitHub
I've realized that the to_undirected(edge_index, num_nodes=None) function does not take the edge features list as an input, only the edge ...
Read more >
Edge List, Adjacency List, Adjacency Matrix - Why Graphs ...
Undirected graphs have edges that do not have a direction. With undirected graphs, we can represent two-way relationships so an edge can be...
Read more >
Graph with undirected edges - MATLAB - MathWorks
Create a graph object with three nodes and two edges. One edge is between node 1 and node 2, and the other edge...
Read more >
DGLGraph – Graph with node/edge features - DGL Docs
The graph stores nodes, edges and also their features. DGL graph is always directional. Undirected graph can be represented using two bi-directional edges....
Read more >
Undirected Graphs - Algorithms, 4th Edition
Preferential attachment graphs. Create a random graph on V vertices and E edges as follows: start with V vertices v1, .., vn in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found