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

Getting rid of need for alignments in iVector training in AMI #1514

Merged
merged 1 commit into from
Apr 2, 2017

Conversation

david-ryan-snyder
Copy link
Contributor

This only partially satisfies Issue #1123. I think it will be easier to commit support for this feature one recipe at a time. This starts with AMI.

  • Adds a script in steps/online/nnet2/get_pca_transform.sh which estimates a PCA transform to be used as an alternative to LDA+MLLT for ivectors

In egs/ami/s5b

  • Adding local/chain/tuning/run_tdnn_1d.sh which is like local/chain/tuning/run_tdnn_1b.sh but uses PCA features for the ivector instead of LDA

  • Updating RESULTS_ihm to show results with the above tuning script (run_tdnn_1d)

  • Updating local/nnet3/run_ivector_common.sh to support either PCA or LDA features (LDA is by default)

%WER 22.5 | 13098 94490 | 80.6 10.8 8.6 3.1 22.5 55.0 | 0.072 | exp/ihm/chain_cleaned/tdnn_sp_bi/decode_dev/ascore_10/dev_hires.ctm.filt.sys
%WER 22.5 | 12643 89978 | 80.3 12.5 7.2 2.7 22.5 53.1 | 0.149 | exp/ihm/chain_cleaned/tdnn_sp_bi/decode_eval/ascore_10/eval_hires.ctm.filt.sys

# cleanup + chain TDNN model. Uses PCA instead of LDA for ivector features.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rerun the baseline? I suspect something else may have changed since it was last run.
And can you put the output of one of those compare_wer.sh scripts inside the 1d script, showing
how it differs from 1b?
If 1d is the best script so far, you could update the link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Starting it now.

@david-ryan-snyder
Copy link
Contributor Author

david-ryan-snyder commented Mar 27, 2017

@danpovey,

I'm not sure how we should be handling the interaction between the older ivector extractors used in the other nnet3 recipes in AMI, and the one I'm updating (local/chain/run_tdnn.sh). To make my concern concrete:

If the user runs some nnet3 script in local (something that isn't local/chain/run_tdnn.sh) he will get an ivector extractor in exp/ihm/nnet3_cleaned/ that is trained using the default LDA features. However, if the user then runs local/chain/run_tdnn.sh (the one updated in this PR) from --stage 4 or earlier, the old ivector extractor will be obliterated (since they point to the same directory), and replaced with the one trained on PCA features.

A potential solution is to change nnet3_affix=_cleaned to nnet3_affix=1d_cleaned in local/chain/run_tdnn_1d.sh. This will solve the problem of different versions of the ivector overriding the other (e.g., LDA vs PCA version). However, there are problems with this approach as well. For example, consider what happens when the user wants to train a new nnet3 recipe using the same PCA ivectors. Now he has to set nnet3_affix=1d_cleaned, which I think is confusing and will make the contents of exp/ uglier, or alternatively, he has to train a new ivector extractor for each new nnet3 system, but that's unnecessarily wasteful.

@danpovey
Copy link
Contributor

danpovey commented Mar 27, 2017 via email

@david-ryan-snyder
Copy link
Contributor Author

@danpovey,

OK, we can do that if that looks to be the best option.

But, elsewhere you simply check to see if some model or directory already exists, and if it does, you print out something like "already exists, refusing to overwrite it." Why not do a similar thing for the UBM and i-vector directories or models?

@danpovey
Copy link
Contributor

danpovey commented Mar 27, 2017 via email

@danpovey
Copy link
Contributor

danpovey commented Mar 27, 2017 via email

@david-ryan-snyder
Copy link
Contributor Author

OK. Backup it is.

This issue also applies to and needs to be taken care of in the UBM as well, right?

@danpovey
Copy link
Contributor

danpovey commented Mar 27, 2017 via email

@david-ryan-snyder
Copy link
Contributor Author

@danpovey, you can review this now when you get the chance.

The main feature is supporting PCA instead of LDA for the ivector features. For now, results are only reported in the AMI recipe for the default TDNN system. Once we get this through code review, I can start expanding this to other recipes.

In addition to the PCA vs LDA stuff, there's also some changes to the ivector scripts. These consist of the model backup we talked about and some minor changes so that the --cleanup option works correctly (See #1059).

Copy link
Contributor

@danpovey danpovey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some cosmetic comments

num_threads_ubm=32
feat_type=lda
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this ivector_transform_type so as not to confuse it with the feat_type used in other scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@@ -89,6 +89,15 @@ for f in $data/feats.scp "$online_cmvn_config" $srcdir/splice_opts $srcdir/final
[ ! -f "$f" ] && echo "$0: expecting file $f to exist" && exit 1
done

if [ -d "$dir" ]; then
bak_dir=$(mktemp -d ${dir}/backup.XXX);
echo "$0: Directory $dir already exists. Backing up models in ${bak_dir}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

models -> i-vector extractor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the script for training the diagonal UBM. So I can just refer to it as such here, and say "i-vector extractor" in the next script.

@danpovey
Copy link
Contributor

danpovey commented Apr 2, 2017 via email

…ectors used in ASR. Results are reported in the default TDNN recipe in AMI. Updating steps/online/nnet2/{train_diag_ubm.sh,train_ivector_extractor.sh} so that they now backup the contents of their destination directory if it already exists.
@david-ryan-snyder
Copy link
Contributor Author

@danpovey, I addressed your last comments.

@danpovey
Copy link
Contributor

danpovey commented Apr 2, 2017

Thanks! Merging.

@danpovey danpovey merged commit e8ca375 into kaldi-asr:master Apr 2, 2017
kronos-cm added a commit to kronos-cm/kaldi that referenced this pull request Apr 5, 2017
* 'master' of https://github.com/kaldi-asr/kaldi:
  [src] Cosmetic change: remove 'train.tra' from usage messages (kaldi-asr#1529)
  [src] cudamatrix: speed up AddColSumMat with transfrom reduce kernel template (kaldi-asr#1530)
  [build]: remove openfst check (kaldi-asr#1531)
  [build,src,doc] Modify get_version.sh to deal better with whitespace (avoid space in version); minor fixes (kaldi-asr#1526)
  [scripts,egs] Adding options for using PCA instead of LDA+MLLT for ivectors used in ASR. Results are reported in the default TDNN recipe in AMI. Updating steps/online/nnet2/{train_diag_ubm.sh,train_ivector_extractor.sh} so that they now backup the contents of their destination directory if it already exists. (kaldi-asr#1514)
  [src] (minor) Added missing SetZero() to NaturalGradientAffineComponent::Scale() if scale==0.0 (kaldi-asr#1522)
  [src,doc] Fix several unrelated minor problems.  Thanks: gaoxinglong
  [src] Adding noexcept to hashing function objects (kaldi-asr#1519)
  [egs] Fix to egs/wsj/s5/run.sh (unset variable) (kaldi-asr#1517)
  [misc] remove eXecute permissions where not needed (kaldi-asr#1515)
  [src,scripts]: Several unrelated cosmetic changes
  [egs] fixes to babel pipeline; thanks to Fred Richardson (kaldi-asr#1509)
  [src] Fix exit code of extract-rows.cc (kaldi-asr#1510)
david-ryan-snyder added a commit to david-ryan-snyder/kaldi that referenced this pull request Apr 12, 2017
…ectors used in ASR. Results are reported in the default TDNN recipe in AMI. Updating steps/online/nnet2/{train_diag_ubm.sh,train_ivector_extractor.sh} so that they now backup the contents of their destination directory if it already exists. (kaldi-asr#1514)
Skaiste pushed a commit to Skaiste/idlak that referenced this pull request Sep 26, 2018
…ectors used in ASR. Results are reported in the default TDNN recipe in AMI. Updating steps/online/nnet2/{train_diag_ubm.sh,train_ivector_extractor.sh} so that they now backup the contents of their destination directory if it already exists. (kaldi-asr#1514)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants