Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more stats to the training log #5147

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions espnet2/train/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,17 @@ def train_one_epoch(
scaler.update()

else:
reporter.register(
{
"grad_norm": grad_norm,
"clip": torch.where(
grad_norm > grad_clip,
grad_norm.new_tensor(100),
grad_norm.new_tensor(0),
),
"loss_scale": scaler.get_scale() if scaler else 1.0,
}
)
all_steps_are_invalid = False
with reporter.measure_time("optim_step_time"):
for iopt, (optimizer, scheduler) in enumerate(
Expand Down