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
ae8cbde5
Unverified
Commit
ae8cbde5
authored
Apr 25, 2023
by
Rhett Ying
Committed by
GitHub
Apr 25, 2023
Browse files
[benchmarks] fix torchmetrics accuracy (#5594)
parent
b740c3f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
benchmarks/benchmarks/model_acc/bench_rgcn_base.py
benchmarks/benchmarks/model_acc/bench_rgcn_base.py
+6
-1
benchmarks/benchmarks/model_speed/bench_rgcn_base.py
benchmarks/benchmarks/model_speed/bench_rgcn_base.py
+0
-1
No files found.
benchmarks/benchmarks/model_acc/bench_rgcn_base.py
View file @
ae8cbde5
...
@@ -61,6 +61,11 @@ def track_acc(dataset, ns_mode):
...
@@ -61,6 +61,11 @@ def track_acc(dataset, ns_mode):
with
torch
.
no_grad
():
with
torch
.
no_grad
():
logits
=
model
(
g
)
logits
=
model
(
g
)
logits
=
logits
[
target_idx
]
logits
=
logits
[
target_idx
]
test_acc
=
accuracy
(
logits
[
test_idx
].
argmax
(
dim
=
1
),
labels
[
test_idx
]).
item
()
test_acc
=
accuracy
(
logits
[
test_idx
].
argmax
(
dim
=
1
),
labels
[
test_idx
],
task
=
"multiclass"
,
num_classes
=
num_classes
,
).
item
()
return
test_acc
return
test_acc
benchmarks/benchmarks/model_speed/bench_rgcn_base.py
View file @
ae8cbde5
...
@@ -3,7 +3,6 @@ import time
...
@@ -3,7 +3,6 @@ import time
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
torchmetrics.functional
import
accuracy
from
..
import
rgcn
,
utils
from
..
import
rgcn
,
utils
...
...
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