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.

Add graph batching support to `dgl.knn_graph()`

See original GitHub issue

🚀 Feature

Adding graph batching support to dgl.knn_graph()

Motivation

Being able to provide a batch of coordinates/features to knn_graph() would allow users to develop much more efficient graph construction pipelines in their projects.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jermainewangcommented, Aug 24, 2022

@amorehead To workaround the issue, you can use set_batch_num_nodes and set_batch_num_edges to override those information manually. There is an ongoing PR to fix this issue.

2reactions
lygztqcommented, Aug 2, 2022

Hi, if your input is a 3D tensor (e.g. [B, N, 3]), I think you can get a batched graph by knn_graphs. You can find an example at the end of the doc here

If your input is not padded, say you have a set of input ([N1, 3], [N2, 3], …), you can also use the dgl.segmented_knn_graph.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Batched Graph Classification with DGL - DGL Docs
Graphs can have various length (e.g. number of nodes and edges). To address this, DGL provides a dgl.batch() API. It leverages the trick...
Read more >
BatchedDGLGraph – Enable batched graph operations
Class for batched DGL graphs. A BatchedDGLGraph basically merges a list of small graphs into a giant graph so that one can perform...
Read more >
Batched Graph Classification with DGL
batching multiple graphs of variable size and shape with DGL; training a graph neural network for a simple graph classification task ...
Read more >
dgl.batch — DGL 0.8.2post1 documentation - DGL Docs
The function supports batching batched graphs. The batch size of the result graph is the sum of the batch sizes of all the...
Read more >
Implementing a batch of batches - Deep Graph Library
I'm trying to use dgl.batch to batch the different independent graphs, and then use dgl.contrib.sampling.NeighborSampler to randomly sample some of the nodes ...
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