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
15d05be3
Unverified
Commit
15d05be3
authored
Dec 04, 2023
by
Zhen Liu
Committed by
GitHub
Dec 04, 2023
Browse files
Fix num_labels to num_classes in dataset files (#6666)
parent
5e64481b
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
python/dgl/data/ppi.py
python/dgl/data/ppi.py
+5
-1
python/dgl/data/qm7b.py
python/dgl/data/qm7b.py
+5
-0
python/dgl/data/qm9.py
python/dgl/data/qm9.py
+10
-0
No files found.
python/dgl/data/ppi.py
View file @
15d05be3
...
...
@@ -59,7 +59,7 @@ class PPIDataset(DGLBuiltinDataset):
Examples
--------
>>> dataset = PPIDataset(mode='valid')
>>> num_la
bel
s = dataset.num_la
bel
s
>>> num_
c
la
sse
s = dataset.num_
c
la
sse
s
>>> for g in dataset:
.... feat = g.ndata['feat']
.... label = g.ndata['label']
...
...
@@ -173,6 +173,10 @@ class PPIDataset(DGLBuiltinDataset):
def
num_labels
(
self
):
return
121
@
property
def
num_classes
(
self
):
return
121
def
__len__
(
self
):
"""Return number of samples in this dataset."""
return
len
(
self
.
graphs
)
...
...
python/dgl/data/qm7b.py
View file @
15d05be3
...
...
@@ -141,6 +141,11 @@ class QM7bDataset(DGLDataset):
"""Number of prediction tasks."""
return
14
@
property
def
num_classes
(
self
):
"""Number of prediction tasks."""
return
14
def
__getitem__
(
self
,
idx
):
r
"""Get graph and label by index
...
...
python/dgl/data/qm9.py
View file @
15d05be3
...
...
@@ -157,6 +157,16 @@ class QM9Dataset(DGLDataset):
"""
return
self
.
label
.
shape
[
1
]
@
property
def
num_classes
(
self
):
r
"""
Returns
--------
int
Number of prediction tasks.
"""
return
self
.
label
.
shape
[
1
]
@
property
def
num_tasks
(
self
):
r
"""
...
...
Prev
1
2
Next
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