Commit b4d99329 authored by Dan Povey's avatar Dan Povey
Browse files

Fixes to UBM training scripts.

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@602 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 9ef086e8
...@@ -34,12 +34,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp ...@@ -34,12 +34,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp
rm -f $dir/.error rm -f $dir/.error
# First do Gaussian selection to 50 components, which will be used
# as the initial screen for all further passes.
for n in 1 2 3; do
feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$n.gz" 2>$dir/gselect_diag.$n.log &
done
wait;
[ -f $dir/.error ] && echo "Error doing GMM selection" && exit 1;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2 3; do for n in 1 2 3; do
feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |" feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
$dir/$x.$n.acc 2> $dir/acc.$x.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "$feats" \
$dir/$x.$n.acc ) 2> $dir/acc.$x.$n.log || touch $dir/.error &
done done
wait; wait;
[ -f $dir/.error ] && echo "Error accumulating stats" && exit 1; [ -f $dir/.error ] && echo "Error accumulating stats" && exit 1;
...@@ -48,6 +60,7 @@ for x in 0 1 2 3; do ...@@ -48,6 +60,7 @@ for x in 0 1 2 3; do
rm $dir/$x.{1,2,3}.acc $dir/$x.ubm rm $dir/$x.{1,2,3}.acc $dir/$x.ubm
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.ubm 2>/dev/null rm $dir/final.ubm 2>/dev/null
ln -s 4.ubm $dir/final.ubm ln -s 4.ubm $dir/final.ubm
...@@ -34,13 +34,24 @@ head -7138 data/train.scp | scripts/subset_scp.pl 3500 - > $dir/train.scp ...@@ -34,13 +34,24 @@ head -7138 data/train.scp | scripts/subset_scp.pl 3500 - > $dir/train.scp
scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp
rm -f $dir/.error rm -f $dir/.error
# First do Gaussian selection to 50 components, which will be used
# as the initial screen for all further passes.
for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$n.gz" 2>$dir/gselect_diag.$n.log &
done
wait;
[ -f $dir/.error ] && echo "Error doing GMM selection" && exit 1;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2 3; do for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- |" feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
$dir/$x.$n.acc 2> $dir/acc.$x.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "$feats" \
$dir/$x.$n.acc ) 2> $dir/acc.$x.$n.log || touch $dir/.error &
done done
wait; wait;
[ -f $dir/.error ] && echo "Error accumulating stats" && exit 1; [ -f $dir/.error ] && echo "Error accumulating stats" && exit 1;
...@@ -49,6 +60,7 @@ for x in 0 1 2 3; do ...@@ -49,6 +60,7 @@ for x in 0 1 2 3; do
rm $dir/$x.{1,2,3}.acc $dir/$x.ubm rm $dir/$x.{1,2,3}.acc $dir/$x.ubm
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.ubm 2>/dev/null rm $dir/final.ubm 2>/dev/null
ln -s 4.ubm $dir/final.ubm ln -s 4.ubm $dir/final.ubm
...@@ -36,13 +36,24 @@ cp $srcdir/train.scp $dir/ ...@@ -36,13 +36,24 @@ cp $srcdir/train.scp $dir/
scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp
rm -f $dir/.error rm -f $dir/.error
# First do Gaussian selection to 50 components, which will be used
# as the initial screen for all further passes.
for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$n.gz" 2>$dir/gselect_diag.$n.log &
done
wait;
[ -f $dir/.error ] && echo "Error doing GMM selection" && exit 1;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2 3; do for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |" feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
$dir/$x.$n.acc 2> $dir/acc.$x.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "$feats" \
$dir/$x.$n.acc ) 2> $dir/acc.$x.$n.log || touch $dir/.error &
done done
wait; wait;
[ -f $dir/.error ] && echo "Error accumulating stats" && exit 1; [ -f $dir/.error ] && echo "Error accumulating stats" && exit 1;
...@@ -51,6 +62,7 @@ for x in 0 1 2 3; do ...@@ -51,6 +62,7 @@ for x in 0 1 2 3; do
rm $dir/$x.{1,2,3}.acc $dir/$x.ubm rm $dir/$x.{1,2,3}.acc $dir/$x.ubm
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.ubm 2>/dev/null rm $dir/final.ubm 2>/dev/null
ln -s 4.ubm $dir/final.ubm ln -s 4.ubm $dir/final.ubm
...@@ -33,12 +33,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp ...@@ -33,12 +33,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp
rm -f $dir/.error rm -f $dir/.error
# First do Gaussian selection to 50 components, which will be used
# as the initial screen for all further passes.
for n in 1 2 3; do
feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$n.gz" 2>$dir/gselect_diag.$n.log &
done
wait;
[ -f $dir/.error ] && echo "Error doing GMM selection" && exit 1;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2 3; do for n in 1 2 3; do
feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |" feats="ark:add-deltas scp:$dir/train${n}.scp ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
$dir/$x.$n.acc 2> $dir/acc.$x.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "$feats" \
$dir/$x.$n.acc ) 2> $dir/acc.$x.$n.log || touch $dir/.error &
done done
wait; wait;
[ -f $dir/.error ] && echo "Error accumulating stats" && exit 1; [ -f $dir/.error ] && echo "Error accumulating stats" && exit 1;
...@@ -48,5 +60,6 @@ for x in 0 1 2 3; do ...@@ -48,5 +60,6 @@ for x in 0 1 2 3; do
done done
rm $dir/final.ubm 2>/dev/null rm $dir/final.ubm 2>/dev/null
rm $dir/gselect_diag.*.gz
ln -s 4.ubm $dir/final.ubm ln -s 4.ubm $dir/final.ubm
...@@ -43,14 +43,24 @@ scripts/split_scp.pl $dir/train_m.scp $dir/train_m{1,2}.scp ...@@ -43,14 +43,24 @@ scripts/split_scp.pl $dir/train_m.scp $dir/train_m{1,2}.scp
scripts/split_scp.pl $dir/train_f.scp $dir/train_f{1,2}.scp scripts/split_scp.pl $dir/train_f.scp $dir/train_f{1,2}.scp
rm -f $dir/.error rm -f $dir/.error
for n in 1 2; do
for g in m f; do
feats="ark:add-deltas scp:$dir/train_${g}${n}.scp ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.$g.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$g.$n.gz" 2>$dir/gselect_diag.$g.$n.log &
done
done
wait;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2; do for n in 1 2; do
for g in m f; do for g in m f; do
feats="ark:add-deltas scp:$dir/train_${g}${n}.scp ark:- |" feats="ark:add-deltas scp:$dir/train_${g}${n}.scp ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.$g.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$g.$n.gz|" \
$dir/$x.$g.$n.acc 2> $dir/acc.$x.$g.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.$g.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.$g.ubm "$feats" \
$dir/$x.$g.$n.acc ) 2> $dir/acc.$x.$g.$n.log || touch $dir/.error &
done done
done done
wait; wait;
...@@ -62,6 +72,7 @@ for x in 0 1 2 3; do ...@@ -62,6 +72,7 @@ for x in 0 1 2 3; do
done done
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.?.ubm 2>/dev/null rm $dir/final.?.ubm 2>/dev/null
ln -s 4.m.ubm $dir/final.m.ubm ln -s 4.m.ubm $dir/final.m.ubm
ln -s 4.f.ubm $dir/final.f.ubm ln -s 4.f.ubm $dir/final.f.ubm
......
...@@ -37,12 +37,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp ...@@ -37,12 +37,24 @@ scripts/split_scp.pl $dir/train.scp $dir/train{1,2,3}.scp
rm -f $dir/.error rm -f $dir/.error
# First do Gaussian selection to 50 components, which will be used
# as the initial screen for all further passes.
for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$n.gz" 2>$dir/gselect_diag.$n.log &
done
wait;
[ -f $dir/.error ] && echo "Error doing GMM selection" && exit 1;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2 3; do for n in 1 2 3; do
feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |" feats="ark:splice-feats scp:$dir/train${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$n.gz|" \
$dir/$x.$n.acc 2> $dir/acc.$x.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.ubm "$feats" \
$dir/$x.$n.acc ) 2> $dir/acc.$x.$n.log || touch $dir/.error &
done done
wait; wait;
[ -f $dir/.error ] && echo "Error accumulating stats" && exit 1; [ -f $dir/.error ] && echo "Error accumulating stats" && exit 1;
...@@ -51,6 +63,7 @@ for x in 0 1 2 3; do ...@@ -51,6 +63,7 @@ for x in 0 1 2 3; do
rm $dir/$x.{1,2,3}.acc $dir/$x.ubm rm $dir/$x.{1,2,3}.acc $dir/$x.ubm
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.ubm 2>/dev/null rm $dir/final.ubm 2>/dev/null
ln -s 4.ubm $dir/final.ubm ln -s 4.ubm $dir/final.ubm
...@@ -48,13 +48,26 @@ scripts/split_scp.pl $dir/train_f.scp $dir/train_f{1,2}.scp ...@@ -48,13 +48,26 @@ scripts/split_scp.pl $dir/train_f.scp $dir/train_f{1,2}.scp
rm -f $dir/.error rm -f $dir/.error
for n in 1 2; do
for g in m f; do
feats="ark:splice-feats scp:$dir/train_${g}${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
gmm-gselect --n=50 "fgmm-global-to-gmm $dir/0.$g.ubm - |" "$feats" \
"ark:|gzip -c >$dir/gselect_diag.$g.$n.gz" 2>$dir/gselect_diag.$g.$n.log &
done
done
wait;
for x in 0 1 2 3; do for x in 0 1 2 3; do
echo "Pass $x" echo "Pass $x"
for n in 1 2; do for n in 1 2; do
for g in m f; do for g in m f; do
feats="ark:splice-feats scp:$dir/train_${g}${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |" feats="ark:splice-feats scp:$dir/train_${g}${n}.scp ark:- | transform-feats $mat ark:- ark:- | transform-feats $utt2spk_opt \"ark:$trans\" ark:- ark:- |"
fgmm-global-acc-stats --diag-gmm-nbest=15 --binary=false --verbose=2 $dir/$x.$g.ubm "$feats" \ ( gmm-gselect "--gselect=ark:gunzip -c $dir/gselect_diag.$g.$n.gz|" \
$dir/$x.$g.$n.acc 2> $dir/acc.$x.$g.$n.log || touch $dir/.error & "fgmm-global-to-gmm $dir/$x.$g.ubm - |" "$feats" ark:- | \
fgmm-global-acc-stats --gselect=ark:- $dir/$x.$g.ubm "$feats" \
$dir/$x.$g.$n.acc ) 2> $dir/acc.$x.$g.$n.log || touch $dir/.error &
done done
done done
wait; wait;
...@@ -66,7 +79,9 @@ for x in 0 1 2 3; do ...@@ -66,7 +79,9 @@ for x in 0 1 2 3; do
done done
done done
rm $dir/gselect_diag.*.gz
rm $dir/final.?.ubm 2>/dev/null rm $dir/final.?.ubm 2>/dev/null
ln -s 4.m.ubm $dir/final.m.ubm ln -s 4.m.ubm $dir/final.m.ubm
ln -s 4.f.ubm $dir/final.f.ubm ln -s 4.f.ubm $dir/final.f.ubm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment