Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
a7b5085a
"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "5b433d83bb6f5dca5965b544a37f1bc822dee92f"
Unverified
Commit
a7b5085a
authored
Nov 28, 2021
by
esang
Committed by
GitHub
Nov 28, 2021
Browse files
Add a note about the order of TUDataset (#3549)
parent
cd6d1138
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
python/dgl/data/tu.py
python/dgl/data/tu.py
+21
-16
No files found.
python/dgl/data/tu.py
View file @
a7b5085a
...
@@ -34,6 +34,14 @@ class LegacyTUDataset(DGLBuiltinDataset):
...
@@ -34,6 +34,14 @@ class LegacyTUDataset(DGLBuiltinDataset):
num_labels : int
num_labels : int
Number of classes
Number of classes
Notes
-----
LegacyTUDataset uses provided node feature by default. If no feature provided, it uses one-hot node label instead.
If neither labels provided, it uses constant for node feature.
The dataset sorts graphs by their labels.
Shuffle is preferred before manual train/val split.
Examples
Examples
--------
--------
>>> data = LegacyTUDataset('DD')
>>> data = LegacyTUDataset('DD')
...
@@ -59,11 +67,6 @@ class LegacyTUDataset(DGLBuiltinDataset):
...
@@ -59,11 +67,6 @@ class LegacyTUDataset(DGLBuiltinDataset):
Graph(num_nodes=9539, num_edges=47382,
Graph(num_nodes=9539, num_edges=47382,
ndata_schemes={'feat': Scheme(shape=(89,), dtype=torch.float32), '_ID': Scheme(shape=(), dtype=torch.int64)}
ndata_schemes={'feat': Scheme(shape=(89,), dtype=torch.float32), '_ID': Scheme(shape=(), dtype=torch.int64)}
edata_schemes={'_ID': Scheme(shape=(), dtype=torch.int64)})
edata_schemes={'_ID': Scheme(shape=(), dtype=torch.int64)})
Notes
-----
LegacyTUDataset uses provided node feature by default. If no feature provided, it uses one-hot node label instead.
If neither labels provided, it uses constant for node feature.
"""
"""
_url
=
r
"https://www.chrsmrrs.com/graphkerneldatasets/{}.zip"
_url
=
r
"https://www.chrsmrrs.com/graphkerneldatasets/{}.zip"
...
@@ -259,6 +262,18 @@ class TUDataset(DGLBuiltinDataset):
...
@@ -259,6 +262,18 @@ class TUDataset(DGLBuiltinDataset):
as per the original data. Other frameworks such as PyTorch Geometric removes the
as per the original data. Other frameworks such as PyTorch Geometric removes the
duplicates by default. You can remove the duplicate edges with :func:`dgl.to_simple`.
duplicates by default. You can remove the duplicate edges with :func:`dgl.to_simple`.
Graphs may have node labels, node attributes, edge labels, and edge attributes,
varing from different dataset.
Labels are mapped to :math:`\lbrace 0,\cdots,n-1 \rbrace` where :math:`n` is the
number of labels (some datasets have raw labels :math:`\lbrace -1, 1 \rbrace` which
will be mapped to :math:`\lbrace 0, 1 \rbrace`). In previous versions, the minimum
label was added so that :math:`\lbrace -1, 1 \rbrace` was mapped to
:math:`\lbrace 0, 2 \rbrace`.
The dataset sorts graphs by their labels.
Shuffle is preferred before manual train/val split.
Examples
Examples
--------
--------
>>> data = TUDataset('DD')
>>> data = TUDataset('DD')
...
@@ -284,17 +299,7 @@ class TUDataset(DGLBuiltinDataset):
...
@@ -284,17 +299,7 @@ class TUDataset(DGLBuiltinDataset):
Graph(num_nodes=9539, num_edges=47382,
Graph(num_nodes=9539, num_edges=47382,
ndata_schemes={'node_labels': Scheme(shape=(1,), dtype=torch.int64), '_ID': Scheme(shape=(), dtype=torch.int64)}
ndata_schemes={'node_labels': Scheme(shape=(1,), dtype=torch.int64), '_ID': Scheme(shape=(), dtype=torch.int64)}
edata_schemes={'_ID': Scheme(shape=(), dtype=torch.int64)})
edata_schemes={'_ID': Scheme(shape=(), dtype=torch.int64)})
Notes
-----
Graphs may have node labels, node attributes, edge labels, and edge attributes,
varing from different dataset.
Labels are mapped to :math:`\lbrace 0,\cdots,n-1 \rbrace` where :math:`n` is the
number of labels (some datasets have raw labels :math:`\lbrace -1, 1 \rbrace` which
will be mapped to :math:`\lbrace 0, 1 \rbrace`). In previous versions, the minimum
label was added so that :math:`\lbrace -1, 1 \rbrace` was mapped to
:math:`\lbrace 0, 2 \rbrace`.
"""
"""
_url
=
r
"https://www.chrsmrrs.com/graphkerneldatasets/{}.zip"
_url
=
r
"https://www.chrsmrrs.com/graphkerneldatasets/{}.zip"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment