Skip to content

Commit

Permalink
save wer/cer and avg_loss during training
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorLakomkin committed Jun 16, 2017
1 parent cea3b01 commit 82accf6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@ def main():
cer = total_cer / len(test_loader.dataset)
wer *= 100
cer *= 100

loss_results[epoch] = avg_loss
wer_results[epoch] = wer
cer_results[epoch] = cer
print('Validation Summary Epoch: [{0}]\t'
'Average WER {wer:.3f}\t'
'Average CER {cer:.3f}\t'.format(
epoch + 1, wer=wer, cer=cer))

if args.visdom:
loss_results[epoch] = avg_loss
wer_results[epoch] = wer
cer_results[epoch] = cer

# epoch += 1
x_axis = epochs[0:epoch + 1]
y_axis = [loss_results[0:epoch + 1], wer_results[0:epoch + 1], cer_results[0:epoch + 1]]
Expand All @@ -346,9 +346,6 @@ def main():
update='replace',
)
if args.tensorboard:
loss_results[epoch] = avg_loss
wer_results[epoch] = wer
cer_results[epoch] = cer
info = {
'Avg Train Loss': avg_loss,
'Avg WER': wer,
Expand Down

0 comments on commit 82accf6

Please sign in to comment.