We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ede378a commit 4b9d59dCopy full SHA for 4b9d59d
src/11_seq2seq/modules/trainer.py
@@ -163,12 +163,12 @@ def validate(engine, mini_batch):
163
# y = (batch_size, length_m)
164
x, y = mini_batch.src, mini_batch.tgt[0][:, 1:]
165
166
- with autocast(not engine.config.off_autocast):
167
- y_hat = engine.model(x, mini_batch.tgt[0][:, :-1])
168
- loss = engine.crit(
169
- y_hat.contiguous().view(-1, y_hat.size(-1)),
170
- y.contiguous().view(-1),
171
- )
+ #with autocast(not engine.config.off_autocast):
+ y_hat = engine.model(x, mini_batch.tgt[0][:, :-1])
+ loss = engine.crit(
+ y_hat.contiguous().view(-1, y_hat.size(-1)),
+ y.contiguous().view(-1),
+ )
172
173
word_count = int(mini_batch.tgt[1].sum())
174
loss = float(loss / word_count)
0 commit comments