Open Graph Benchmark Lite (ogb_lite) is a subset of the ogb project. It supports library-agnostic loaders and it does not require torch.
Project description
Open Graph Benchmark Lite (ogb_lite)
Open Graph Benchmark Lite (ogb_lite) is a subset of the ogb project. It supports library-agnostic loaders and it does not require torch.
99.99% of the code is copied from the OGB project:
https://github.com/snap-stanford/ogb <https://github.com/snap-stanford/ogb>_
We only make some small changes such that you can use ogb_lite without installing torch.
Installation
.. code-block:: bash
pip install ogb_lite
Tutorial
ogb_lite only contains three library-agnostic loaders: NodePropPredDataset\ , LinkPropPredDataset\ , and GraphPropPredDataset.
NodePropPredDataset:
.. code-block:: python
coding=utf-8
from ogb_lite.nodeproppred import NodePropPredDataset
dataset = NodePropPredDataset(name="ogbn-proteins")
split_idx = dataset.get_idx_split() train_idx, valid_idx, test_idx = split_idx["train"], split_idx["valid"], split_idx["test"] graph, label = dataset[0] # graph: library-agnostic graph object
print(graph, label) print(train_idx, valid_idx, test_idx)
LinkPropPredDataset:
.. code-block:: python
coding=utf-8
from ogb_lite.linkproppred import LinkPropPredDataset
dataset = LinkPropPredDataset(name="ogbl-ppa")
split_edge = dataset.get_edge_split() train_edge, valid_edge, test_edge = split_edge["train"], split_edge["valid"], split_edge["test"] graph = dataset[0] # graph: library-agnostic graph object
print(graph) print(train_edge, valid_edge, test_edge)
GraphPropPredDataset:
.. code-block:: python
coding=utf-8
from ogb_lite.graphproppred import GraphPropPredDataset
dataset = GraphPropPredDataset(name="ogbg-molhiv")
split_idx = dataset.get_idx_split() train_idx, valid_idx, test_idx = split_idx["train"], split_idx["valid"], split_idx["test"]
graph, label = dataset[0] # graph: library-agnostic graph object print(graph, label) print(train_idx, valid_idx, test_idx)
Citing OGB
If you use OGB datasets in your work, please cite the OGB paper (Bibtex below).
.. code-block:: HTML
@article{hu2020ogb, title={Open Graph Benchmark: Datasets for Machine Learning on Graphs}, author={Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, Jure Leskovec}, journal={arXiv preprint arXiv:2005.00687}, year={2020} }
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ogb_lite-0.0.3.tar.gz.
File metadata
- Download URL: ogb_lite-0.0.3.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef59643d4315011d80b4bd716034a8008b229cb64755387ca3ac91e1e2cb8f41
|
|
| MD5 |
fb2198571dd905e2ac29031496e100dd
|
|
| BLAKE2b-256 |
befc8c5c16ee4d0398afbac15fdded1feaaa25a9844794ad035d24bc5cebdd38
|