Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7fa92ea

Browse files
add audio demo.
1 parent 6d3a56f commit 7fa92ea

File tree

4 files changed

+1269
-4
lines changed

4 files changed

+1269
-4
lines changed

‎20pytorch/10.seq2seq_attention.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ def train(model, data, num_epochs=20):
387387
optimizer.step()
388388

389389
if it % 100 == 0:
390-
print("Epoch", epoch, "iteration", it, "loss", loss.item())
390+
print("Epoch :{}/{}, iteration :{}/{} loss:{}".format(epoch, num_epochs,it, len(data), loss.item()))
391391

392-
print("Epoch", epoch, "Training loss", total_loss / total_num_words)
393-
if epoch % 5 == 0:
392+
print("Epoch :{}/{}, Training loss:{}".format(epoch, num_epochs, total_loss / total_num_words))
393+
if epoch % 1 == 0:
394394
evaluate(model, dev_data)
395395

396396

@@ -415,7 +415,7 @@ def translate_dev(i):
415415
trans.append(word)
416416
else:
417417
break
418-
print("".join(trans))
418+
print("".join(trans))
419419

420420

421421
for i in range(100, 120):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /