Last active
August 29, 2015 14:19
-
-
Save SnowMasaya/a26878eff312b59bfc35 to your computer and use it in GitHub Desktop.
Kaldiに関する処理を日本語のドキュメントでまとめてみた(学習編)4 ref: http://qiita.com/GushiSnow/items/d431a5c49dc4206def2d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utils/subset_data_dir.sh data/train 1000 data/train.1k || exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--per-spk #それぞれの話者の発話数を指定 | |
--speakers #ランダムに話者を選択 | |
--shortest #発話をすべて小文字で用意 | |
--first #最初の発話のみ | |
--last #最後の発話のみ | |
--spk-list #話者のリストを取得 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gmm-init-mono $shared_phones_opt "--train-feats=$feats subset-feats --n= 10 ark:- ark:-|" $lang/topo $feat_dim $dir/0.mdl $dir/tree || exit 1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile-train-graphs $dir/tree $dir/0.mdl $lang/L.fst \ | |
"ark:sym2int.pl --map-oov $oov_sym -f 2- $lang/words.txt < $sdata/JOB/te xt|" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
align-equal-compiled "ark:gunzip -c $dir/fsts.JOB.gz|" "$feats" ark,t:- \| \ | |
gmm-acc-stats-ali --binary=true $dir/0.mdl "$feats" ark:- \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gmm-est --min-gaussian-occupancy=3 --mix-up=$numgauss --power=$power \ | |
$dir/0.mdl "gmm-sum-accs - $dir/0.*.acc|" $dir/1.mdl 2> $dir/log/update.0.log || exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x=1 | |
while [ $x -lt $num_iters ]; do | |
echo "$0: Pass $x" | |
if [ $stage -le $x ]; then | |
if echo $realign_iters | grep -w $x >/dev/null; then | |
echo "$0: Aligning data" | |
mdl="gmm-boost-silence --boost=$boost_silence `cat $lang/phones/optional_s | |
ilence.csl` $dir/$x.mdl - |" | |
$cmd JOB=1:$nj $dir/log/align.$x.JOB.log \ | |
gmm-align-compiled $scale_opts --beam=$beam --retry-beam=$[$beam*4] --ca | |
reful=$careful "$mdl" \ | |
"ark:gunzip -c $dir/fsts.JOB.gz|" "$feats" "ark,t:|gzip -c >$dir/ali.JOB | |
.gz" \ | |
|| exit 1; | |
fi | |
$cmd JOB=1:$nj $dir/log/acc.$x.JOB.log \ | |
gmm-acc-stats-ali $dir/$x.mdl "$feats" "ark:gunzip -c $dir/ali.JOB.gz|" \ | |
$dir/$x.JOB.acc || exit 1; | |
$cmd $dir/log/update.$x.log \ | |
gmm-est --write-occs=$dir/$[$x+1].occs --mix-up=$numgauss --power=$power $ | |
dir/$x.mdl \ | |
"gmm-sum-accs - $dir/$x.*.acc|" $dir/$[$x+1].mdl || exit 1; | |
rm $dir/$x.mdl $dir/$x.*.acc $dir/$x.occs 2>/dev/null | |
fi | |
if [ $x -le $max_iter_inc ]; then | |
numgauss=$[$numgauss+$incgauss]; | |
fi | |
beam=10 | |
x=$[$x+1] | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment