code: def compute_progress(dir, iter, run_opts):
      prev_model = "{0}/{1}.mdl".format(dir, iter - 1)
      model = "{0}/{1}.mdl".format(dir, iter)
  
      common_lib.background_command(
          """{command} {dir}/log/progress.{iter}.log \
                  nnet3-am-info {model} '&&' \
                  nnet3-show-progress --use-gpu=no {prev_model} {model}
          """.format(
              command=run_opts.command,
              dir=dir,
              iter=iter,
              model=model,
              prev_model=prev_model,
          )
      )
      if iter % 10 == 0 and iter > 0:
          # Every 10 iters, print some more detailed information.
          # full_progress.X.log contains some diagnostics of the difference in
          # parameters, printed in the same format as from nnet3-info.
          common_lib.background_command(
              """{command} {dir}/log/full_progress.{iter}.log \
              nnet3-show-progress --use-gpu=no --verbose=2 {prev_model} {model}
          """.format(
                  command=run_opts.command,
                  dir=dir,
                  iter=iter,
                  model=model,
                  prev_model=prev_model,
              )
          )
          # full_info.X.log is just the nnet3-info of the model, with the --verbose=2
          # option which includes stats on the singular values of the parameter matrices.
          common_lib.background_command(
              """{command} {dir}/log/full_info.{iter}.log \
              nnet3-info --verbose=2 {model}
          """.format(
                  command=run_opts.command,
                  dir=dir,
                  iter=iter,
                  model=model,
              )
          )
  
file_path: espnet/egs2/aishell4/enh1/steps/libs/nnet3/train/chain_objf/acoustic_model.py
imports: from __future__ import division
  from __future__ import print_function
  import logging
  import math
  import os
  import sys
  import libs.common
  import libs.nnet3.train.common
label_desc: Use image node_id 10 for calling a global function with example usage: compute_progress(dir, iter, run_opts) without return types