dmlc / dmlc/dgl

Support neighbor sampling without neighbor deduplication (e.g. TGATSampler and KGCNSampler)

Open
#4,309 1 comment 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
Support neighbor sampling without neighbor deduplication, examples including TGATSampler and KGCNSampler.

## Motivation

The current neighbor sampling implementation by default will deduplicate the neighbors after sampling to save computation space. This is not always necessary since in some cases we would want to keep the duplicate seed nodes if each seed node requires its own computation dependency. For instance, TGAT samples neighbors according to temporal causality, meaning that the same neighbor node may have different timestamps for different seed nodes. Also, one would sometimes like to know which seed node a K-hop neighbor node belongs to, and assign different features to the neighbor nodes accordingly (e.g. KGCN), which is also hard to do within our current pipeline.

## Alternatives

Users can write their own sampler I guess? But it's not easy to do so with our current `sample_neighbors` and `to_block` interface since `sample_neighbors` do not accept duplicated seed nodes, which will be common if we do not deduplicate them.

## Pitch

Provide at least a `NeighborSamplerWithoutDeduplication` class (the name can change, but the functionality needs to be supported), as well as either TGATSampler or KGCNSampler as an extension.

## Additional context

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.