From 2c0cec86a3f6f7af7108ff8e559c9df6799b6d4a Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Sat, 17 Dec 2022 16:31:24 +0800 Subject: [PATCH] Set batch count less frequently --- egs/librispeech/ASR/pruned_transducer_stateless7/train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/train.py b/egs/librispeech/ASR/pruned_transducer_stateless7/train.py index a1d0061ef..8da246c7c 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/train.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/train.py @@ -858,7 +858,8 @@ def train_one_epoch( # NOTE: We use reduction==sum and loss is computed over utterances # in the batch and there is no normalization to it so far. scaler.scale(loss).backward() - set_batch_count(model, params.batch_idx_train) + if params.batch_idx_train % 10 == 0: + set_batch_count(model, params.batch_idx_train) scheduler.step_batch(params.batch_idx_train) scaler.step(optimizer)