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
a8ce0957
Unverified
Commit
a8ce0957
authored
Jan 02, 2021
by
Pein
Committed by
GitHub
Jan 02, 2021
Browse files
update the code of examples/pytorch/metapath2vec.py (#2463)
Co-authored-by:
Quan (Andy) Gan
<
coin2028@hotmail.com
>
parent
4464b973
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
examples/pytorch/metapath2vec/metapath2vec.py
examples/pytorch/metapath2vec/metapath2vec.py
+4
-4
No files found.
examples/pytorch/metapath2vec/metapath2vec.py
View file @
a8ce0957
...
...
@@ -36,11 +36,11 @@ class Metapath2VecTrainer:
def
train
(
self
):
for
iteration
in
range
(
self
.
iterations
):
print
(
"
\n\n\n
Iteration: "
+
str
(
iteration
+
1
))
optimizer
=
optim
.
SparseAdam
(
self
.
skip_gram_model
.
parameters
(),
lr
=
self
.
initial_lr
)
scheduler
=
torch
.
optim
.
lr_scheduler
.
CosineAnnealingLR
(
optimizer
,
len
(
self
.
dataloader
))
for
iteration
in
range
(
self
.
iterations
):
print
(
"
\n\n\n
Iteration: "
+
str
(
iteration
+
1
))
running_loss
=
0.0
for
i
,
sample_batched
in
enumerate
(
tqdm
(
self
.
dataloader
)):
...
...
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