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

[Feature] Biased Neighbor Sampling #2987

Merged
merged 87 commits into from
Jun 23, 2021
Merged

Conversation

soodoshll
Copy link
Contributor

Description

Use the utilities in #1664 and #1665 to implement a biased neighbor sampling algorithm. In this version of neighbor sampling,
each node is assigned an integer tag , and nodes with different tags have different probabilities(bias) to be sampled. Tag is an analogue of node type under the framework of homogeneous graph.

For example, in a node classification problem, some node are labeled while others are not. Users might want labeled nodes to have higher probability to be sampled. They can set the tag of labeled nodes as 1 and unlabeled nodes as 0, and assign a higher bias for tag 1 than tag 0.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the my best knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change
  • Related issue is referred in this PR
  • If the PR is for a new model/paper, I've updated the example index here.

Changes

@soodoshll soodoshll changed the title [WIP][Feature] Biased Neighbor Sampling [Feature] Biased Neighbor Sampling Jun 10, 2021
python/dgl/sampling/neighbor.py Outdated Show resolved Hide resolved
python/dgl/sampling/neighbor.py Outdated Show resolved Hide resolved
tests/compute/test_sampling.py Outdated Show resolved Hide resolved
@jermainewang jermainewang added this to the v0.7 milestone Jun 23, 2021
@jermainewang jermainewang merged commit e56bbaf into dmlc:master Jun 23, 2021
Rhett-Ying pushed a commit to Rhett-Ying/dgl that referenced this pull request Jun 25, 2021
* update

* update

* update

* update

* lint

* lint

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* lint

* update

* clone

* update

* update

* update

* update

* replace idarray with ndarray

* refactor cpp part

* refactor python part

* debug

* refactor interface

* test and doc

* lint and test

* lint

* fix

* fix

* fix

* const

* doc

* fix

* fix

* fix

* fix

* fix & doc

* fix

* fix

* update

* update

* update

* merge

* doc

* doc

* lint

* fix

* more tests

* doc

* fix

* fix

* update

* update

* update

* fix

* fix

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants