dmlc / dmlc/dgl

[RFC] Add a MFG back to Subgraph function

Open
#2,909 4 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature
A utility function to revert a sampled MFGs to a DGLGraph in heterogeneous graphs.

Input: an MFGs that come from NeighborSampler and NodeDataLoader
Output: 3 objects
> A dictionary of node ids, where a key is a node types, and a value is a tuple of new subgraph node ids and original graph node ids.
> A dictionary of edges in the form of a tuple of a source node id list and a destination node list where ids are the **new subgraph node ids**.
> A dictionary of edges in the form of a tuple of a source node id list and a destination node list where ids are the **original graph node ids**.

## Motivation
To have various GNN model explainers work, it is required to extract the same subgraph that computes the final prediction for either visualization or explainer training. In mini-batch mode, DGL uses MFGs to facilitate computation. But MFGs cannot directly be used for visualization or explainer training. This is even true in heterogeneous graphs.

## Alternatives
No

## Pitch
No

## Additional context
I have written a function to meet the above requirements. But not PR yet.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.