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
ee651811
"...text-generation-inference.git" did not exist on "b32e9ce9d5e5b73082e31bf5d75c458dba29d30c"
Unverified
Commit
ee651811
authored
Aug 02, 2023
by
Andrei Ivanov
Committed by
GitHub
Aug 03, 2023
Browse files
Improving the output for the Cluster GCN example. (#6079)
parent
03839413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
examples/pytorch/cluster_gcn/cluster_gcn.py
examples/pytorch/cluster_gcn/cluster_gcn.py
+9
-5
No files found.
examples/pytorch/cluster_gcn/cluster_gcn.py
View file @
ee651811
...
...
@@ -59,7 +59,7 @@ dataloader = dgl.dataloading.DataLoader(
)
durations
=
[]
for
_
in
range
(
10
):
for
epoch
in
range
(
10
):
t0
=
time
.
time
()
model
.
train
()
for
it
,
sg
in
enumerate
(
dataloader
):
...
...
@@ -80,9 +80,10 @@ for _ in range(10):
)
mem
=
torch
.
cuda
.
max_memory_allocated
()
/
1000000
print
(
"Loss"
,
loss
.
item
(),
"Acc"
,
acc
.
item
(),
"GPU Mem"
,
mem
,
"MB"
)
tt
=
time
.
time
()
print
(
tt
-
t0
)
durations
.
append
(
tt
-
t0
)
tt
=
time
.
time
()
-
t0
print
(
"Run time for epoch# %d: %.2fs"
%
(
epoch
,
tt
))
durations
.
append
(
tt
)
model
.
eval
()
with
torch
.
no_grad
():
...
...
@@ -116,4 +117,7 @@ for _ in range(10):
)
print
(
"Validation acc:"
,
val_acc
.
item
(),
"Test acc:"
,
test_acc
.
item
())
print
(
np
.
mean
(
durations
[
4
:]),
np
.
std
(
durations
[
4
:]))
print
(
"Average run time for last %d epochs: %.2fs standard deviation: %.3f"
%
((
epoch
-
3
),
np
.
mean
(
durations
[
4
:]),
np
.
std
(
durations
[
4
:]))
)
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