"src/rpc/vscode:/vscode.git/clone" did not exist on "4e5780e3e3000f18cc991d753898c3b1aae285f1"
Unverified Commit a8ce0957 authored by Pein's avatar Pein Committed by GitHub
Browse files

update the code of examples/pytorch/metapath2vec.py (#2463)


Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent 4464b973
......@@ -36,11 +36,11 @@ class Metapath2VecTrainer:
def train(self):
for iteration in range(self.iterations):
print("\n\n\nIteration: " + 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\nIteration: " + str(iteration + 1))
running_loss = 0.0
for i, sample_batched in enumerate(tqdm(self.dataloader)):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment