code: def compute_train_cv_probabilities(
      dir,
      iter,
      egs_dir,
      l2_regularize,
      xent_regularize,
      leaky_hmm_coefficient,
      run_opts,
      use_multitask_egs=False,
      chain_opts="",
  ):
      model = "{0}/{1}.mdl".format(dir, iter)
      scp_or_ark = "scp" if use_multitask_egs else "ark"
      egs_suffix = ".scp" if use_multitask_egs else ".cegs"
  
      multitask_egs_opts = common_train_lib.get_multitask_egs_opts(
          egs_dir,
          egs_prefix="valid_diagnostic.",
          use_multitask_egs=use_multitask_egs,
      )
  
      common_lib.background_command(
          """{command} {dir}/log/compute_prob_valid.{iter}.log \
                  nnet3-chain-compute-prob --l2-regularize={l2} {chain_opts} \
                  --leaky-hmm-coefficient={leaky} --xent-regularize={xent_reg} \
                  {model} {dir}/den.fst \
                  "ark,bg:nnet3-chain-copy-egs {multitask_egs_opts} {scp_or_ark}:{egs_dir}/valid_diagnostic{egs_suffix} \
                      ark:- | nnet3-chain-merge-egs --minibatch-size=1:64 ark:- ark:- |" \
          """.format(
              command=run_opts.command,
              dir=dir,
              iter=iter,
              model=model,
              l2=l2_regularize,
              leaky=leaky_hmm_coefficient,
              xent_reg=xent_regularize,
              egs_dir=egs_dir,
              multitask_egs_opts=multitask_egs_opts,
              scp_or_ark=scp_or_ark,
              egs_suffix=egs_suffix,
              chain_opts=chain_opts,
          )
      )
  
      multitask_egs_opts = common_train_lib.get_multitask_egs_opts(
          egs_dir,
          egs_prefix="train_diagnostic.",
          use_multitask_egs=use_multitask_egs,
      )
  
      common_lib.background_command(
          """{command} {dir}/log/compute_prob_train.{iter}.log \
                  nnet3-chain-compute-prob --l2-regularize={l2} {chain_opts} \
                  --leaky-hmm-coefficient={leaky} --xent-regularize={xent_reg} \
                  {model} {dir}/den.fst \
                  "ark,bg:nnet3-chain-copy-egs {multitask_egs_opts} {scp_or_ark}:{egs_dir}/train_diagnostic{egs_suffix} \
                      ark:- | nnet3-chain-merge-egs --minibatch-size=1:64 ark:- ark:- |" \
          """.format(
              command=run_opts.command,
              dir=dir,
              iter=iter,
              model=model,
              l2=l2_regularize,
              leaky=leaky_hmm_coefficient,
              xent_reg=xent_regularize,
              egs_dir=egs_dir,
              multitask_egs_opts=multitask_egs_opts,
              scp_or_ark=scp_or_ark,
              egs_suffix=egs_suffix,
              chain_opts=chain_opts,
          )
      )
  
file_path: espnet/egs2/jv_openslr35/asr1/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 9 for calling a global function with example usage: compute_train_cv_probabilities(dir, iter, egs_dir, l2_regularize, xent_regularize, leaky_hmm_coefficient, run_opts, use_multitask_egs, chain_opts) without return types