Skip to content

Commit

Permalink
[scripts,src] Fix to multitask nnet3 training (kaldi-asr#2818); cosme…
Browse files Browse the repository at this point in the history
…tic code change.
  • Loading branch information
danpovey committed Nov 8, 2018
1 parent ec7e592 commit 6ba204f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion egs/wsj/s5/steps/libs/nnet3/train/common.py
Expand Up @@ -69,9 +69,12 @@ def get_multitask_egs_opts(egs_dir, egs_prefix="",
'--output=ark:foo/egs/output.3.ark --weight=ark:foo/egs/weights.3.ark'
i.e. egs_prefix is "" for train and
"valid_diagnostic." for validation.
Caution: archive_index is usually an integer, but may be a string ("JOB")
in some cases.
"""
multitask_egs_opts = ""
egs_suffix = ".{0}".format(archive_index) if archive_index > -1 else ""
egs_suffix = ".{0}".format(archive_index) if archive_index != -1 else ""

if use_multitask_egs:
output_file_name = ("{egs_dir}/{egs_prefix}output{egs_suffix}.ark"
Expand Down
2 changes: 1 addition & 1 deletion src/rnnlm/rnnlm-example-utils.cc
Expand Up @@ -290,7 +290,7 @@ static void ProcessRnnlmOutputNoSampling(
row_sums.ApplyLog();
BaseFloat ans = -VecVec(row_sums, minibatch.output_weights);
*objf_den_exact = ans;
if (fabs(ans) > 100) {
if (fabs(ans) > 1.0 * nnet_output.NumRows()) {
KALDI_WARN << "Big den objf " << ans;
}
}
Expand Down

0 comments on commit 6ba204f

Please sign in to comment.