-
Notifications
You must be signed in to change notification settings - Fork 3k
[GraphBolt][Dataset] Contribute IGBH dataset to hetero examples. #7708
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
Open
BowenYao18
wants to merge
56
commits into
dmlc:master
Choose a base branch
from
BowenYao18:add-igbh-to-rgcn
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
6441133
contribute three IGB dataset (small version)
abb9f39
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 85d92c8
contribute three IGB dataset (small version)
5d2fe56
contribute three IGB dataset (small version)
543f672
format the code with ufmt
6bf10cb
added documentation
5fc930b
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 42717af
Update examples/graphbolt/rgcn/download.py
BowenYao18 06f3f29
Update examples/graphbolt/rgcn/download.py
BowenYao18 19f18a5
Update examples/graphbolt/rgcn/download.py
BowenYao18 97c1735
Update examples/graphbolt/rgcn/download.py
BowenYao18 93cb70f
added 2983 class task
b170a90
fix lint
55079b8
Update examples/graphbolt/rgcn/download.py
BowenYao18 ce65746
remove labels from yaml
8660565
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 0e0fa09
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 3322987
add doenload script
0135b4b
corrected path in processing file
BowenYao18 7a35313
modify yaml file builder
BowenYao18 217b885
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 6e0365b
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 96c96ad
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 4b680c7
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 bbf4c97
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 c9789cd
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 39c9772
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 6a9a9dc
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 c645bb7
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 2a6244e
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 befc958
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 422ccbe
add igb-het-[tiny|small]
eb62d9f
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 8e51701
resolve merge conflict
337d416
Merge branch 'master' into add-igbh-to-rgcn
BowenYao18 aaf1da1
Update examples/graphbolt/pyg/hetero/node_classification.py
BowenYao18 ebdb01f
Update examples/graphbolt/pyg/hetero/node_classification.py
BowenYao18 d50977d
Update examples/graphbolt/pyg/hetero/node_classification.py
BowenYao18 1b54977
Merge branch 'master' into add-igbh-to-rgcn
BowenYao18 071d055
remove main args
f31d354
remove script
9e445c6
add all reverse edge type
e1607ab
Merge branch 'master' into add-igbh-to-rgcn
mfbalin b043999
add igb-het-large
BowenYao18 2657ee1
fix format
BowenYao18 d11f815
fix lint
BowenYao18 de7dc90
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 2537811
Merge branch 'dmlc:master' into add-igbh-to-rgcn
BowenYao18 692912e
fix acc drop bug
BowenYao18 5dfd3fd
fix acc drop bug
BowenYao18 65c9b80
Update node_classification.py
BowenYao18 4b2a7fb
add dataset name
4f3f355
fix lint
8c21ef4
change mlperf to lower
098efbe
reduce evaluator
8e30170
reduce evaluator
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use pure pytorch operations to compute the evaluation score. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import numpy as np | ||
|
||
try: | ||
import torch | ||
except ImportError: | ||
torch = None | ||
|
||
|
||
class IGB_Evaluator: | ||
def __init__(self, name, num_tasks): | ||
self.name = name | ||
self.num_tasks = num_tasks | ||
|
||
def _parse_input(self, input_dict): | ||
y_true, y_pred = input_dict["y_true"], input_dict["y_pred"] | ||
|
||
if torch and isinstance(y_true, torch.Tensor): | ||
y_true = y_true.cpu().numpy() | ||
if torch and isinstance(y_pred, torch.Tensor): | ||
y_pred = y_pred.cpu().numpy() | ||
|
||
if not isinstance(y_true, np.ndarray) or not isinstance( | ||
y_pred, np.ndarray | ||
): | ||
raise RuntimeError("Arguments must be numpy arrays") | ||
|
||
if y_true.shape != y_pred.shape or y_true.ndim != 2: | ||
raise RuntimeError("Shape mismatch between y_true and y_pred") | ||
|
||
return y_true, y_pred | ||
|
||
def _eval_acc(self, y_true, y_pred): | ||
return {"acc": np.mean(np.all(y_true == y_pred, axis=1))} | ||
|
||
def eval(self, input_dict): | ||
y_true, y_pred = self._parse_input(input_dict) | ||
return self._eval_acc(y_true, y_pred) |
mfbalin marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.