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
pyg_autoscale
Commits
dedc6950
Commit
dedc6950
authored
Jun 08, 2021
by
rusty1s
Browse files
doc
parent
bd487011
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
large_benchmark/main.py
large_benchmark/main.py
+5
-0
No files found.
large_benchmark/main.py
View file @
dedc6950
...
@@ -37,6 +37,7 @@ def mini_train(model, loader, criterion, optimizer, max_steps, grad_norm=None):
...
@@ -37,6 +37,7 @@ def mini_train(model, loader, criterion, optimizer, max_steps, grad_norm=None):
total_loss
+=
float
(
loss
)
*
int
(
train_mask
.
sum
())
total_loss
+=
float
(
loss
)
*
int
(
train_mask
.
sum
())
total_examples
+=
int
(
train_mask
.
sum
())
total_examples
+=
int
(
train_mask
.
sum
())
# We abort after a fixed number of steps to refresh histories...
if
(
i
+
1
)
>=
max_steps
and
(
i
+
1
)
<
len
(
loader
):
if
(
i
+
1
)
>=
max_steps
and
(
i
+
1
)
<
len
(
loader
):
break
break
...
@@ -106,6 +107,8 @@ def main(conf):
...
@@ -106,6 +107,8 @@ def main(conf):
t
=
time
.
perf_counter
()
t
=
time
.
perf_counter
()
print
(
'Calculating buffer size...'
,
end
=
' '
,
flush
=
True
)
print
(
'Calculating buffer size...'
,
end
=
' '
,
flush
=
True
)
# We reserve a much larger buffer size than what is actually needed for
# training in order to perform efficient history accesses during inference.
buffer_size
=
max
([
n_id
.
numel
()
for
_
,
_
,
n_id
,
_
,
_
in
eval_loader
])
buffer_size
=
max
([
n_id
.
numel
()
for
_
,
_
,
n_id
,
_
,
_
in
eval_loader
])
print
(
f
'Done! [
{
time
.
perf_counter
()
-
t
:.
2
f
}
s] ->
{
buffer_size
}
'
)
print
(
f
'Done! [
{
time
.
perf_counter
()
-
t
:.
2
f
}
s] ->
{
buffer_size
}
'
)
...
@@ -147,6 +150,8 @@ def main(conf):
...
@@ -147,6 +150,8 @@ def main(conf):
val_acc
=
compute_acc
(
out
,
data
.
y
,
data
.
val_mask
)
val_acc
=
compute_acc
(
out
,
data
.
y
,
data
.
val_mask
)
tmp_test_acc
=
compute_acc
(
out
,
data
.
y
,
data
.
test_mask
)
tmp_test_acc
=
compute_acc
(
out
,
data
.
y
,
data
.
test_mask
)
else
:
else
:
# We need to perform inference on a different graph as PPI is an
# inductive dataset.
val_acc
=
compute_acc
(
full_test
(
model
,
val_data
),
val_data
.
y
)
val_acc
=
compute_acc
(
full_test
(
model
,
val_data
),
val_data
.
y
)
tmp_test_acc
=
compute_acc
(
full_test
(
model
,
test_data
),
tmp_test_acc
=
compute_acc
(
full_test
(
model
,
test_data
),
test_data
.
y
)
test_data
.
y
)
...
...
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