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
2584f3af
"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "6a7a5467cab6df8bb24b20a7ad3f2223c1a2e8de"
Unverified
Commit
2584f3af
authored
Aug 02, 2023
by
Andrei Ivanov
Committed by
GitHub
Aug 03, 2023
Browse files
Improving the HGT example. (#6069)
parent
ee651811
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
examples/pytorch/hgt/train_acm.py
examples/pytorch/hgt/train_acm.py
+1
-3
No files found.
examples/pytorch/hgt/train_acm.py
View file @
2584f3af
...
...
@@ -49,7 +49,6 @@ def get_n_params(model):
def
train
(
model
,
G
):
best_val_acc
=
torch
.
tensor
(
0
)
best_test_acc
=
torch
.
tensor
(
0
)
train_step
=
torch
.
tensor
(
0
)
for
epoch
in
np
.
arange
(
args
.
n_epoch
)
+
1
:
model
.
train
()
logits
=
model
(
G
,
"paper"
)
...
...
@@ -59,8 +58,7 @@ def train(model, G):
loss
.
backward
()
torch
.
nn
.
utils
.
clip_grad_norm_
(
model
.
parameters
(),
args
.
clip
)
optimizer
.
step
()
train_step
+=
1
scheduler
.
step
(
train_step
)
scheduler
.
step
()
if
epoch
%
5
==
0
:
model
.
eval
()
logits
=
model
(
G
,
"paper"
)
...
...
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