Skip to content
Snippets Groups Projects
Commit 2884f22c authored by Karel Vesely's avatar Karel Vesely
Browse files

trunk,nnet1 : adding lstm example for tedlium (needs tuning)


git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4876 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 5269f0f1
Branches
No related tags found
No related merge requests found
--window-type=hamming # disable Dans window, use the standard
--use-energy=false # only fbank outputs
--dither=1
--num-mel-bins=40 # 8 filters/octave, 40 filters/16Khz as used by IBM
--htk-compat=true # try to make it compatible with HTK
--nccf-ballast-online=true # helps for online operation.
#!/bin/bash
# Copyright 2015 Brno University of Technology (Author: Karel Vesely)
# Apache 2.0
# This example script trains a LSTM network on FBANK features.
# The LSTM code comes from Yiayu DU, and Wei Li, thanks!
. ./cmd.sh
. ./path.sh
dev=data-fbank/test
train=data-fbank/train
dev_original=data/test
train_original=data/train
gmm=exp/tri3
stage=0
. utils/parse_options.sh || exit 1;
# Make the FBANK features
[ ! -e $dev ] && if [ $stage -le 0 ]; then
# Dev set
utils/copy_data_dir.sh $dev_original $dev || exit 1; rm $dev/{cmvn,feats}.scp
steps/make_fbank_pitch.sh --nj 10 --cmd "$train_cmd" \
$dev $dev/log $dev/data || exit 1;
steps/compute_cmvn_stats.sh $dev $dev/log $dev/data || exit 1;
# Training set
utils/copy_data_dir.sh $train_original $train || exit 1; rm $train/{cmvn,feats}.scp
steps/make_fbank_pitch.sh --nj 10 --cmd "$train_cmd -tc 10" \
$train $train/log $train/data || exit 1;
steps/compute_cmvn_stats.sh $train $train/log $train/data || exit 1;
# Split the training set
utils/subset_data_dir_tr_cv.sh --cv-spk-percent 10 $train ${train}_tr90 ${train}_cv10
fi
if [ $stage -le 1 ]; then
# Train the DNN optimizing per-frame cross-entropy.
dir=exp/lstm4f
ali=${gmm}_ali
# Train
$cuda_cmd $dir/log/train_nnet.log \
steps/nnet/train.sh --network-type lstm --learn-rate 0.0001 \
--cmvn-opts "--norm-means=true --norm-vars=true" --feat-type plain --splice 0 \
--train-opts "--momentum 0.9 --halving-factor 0.8" \
--train-tool "nnet-train-lstm-streams --num-stream=4 --targets-delay=5" \
${train}_tr90 ${train}_cv10 data/lang $ali $ali $dir || exit 1;
# Decode (reuse HCLG graph)
steps/nnet/decode.sh --nj 20 --cmd "$decode_cmd" --config conf/decode_dnn.config --acwt 0.1 \
$gmm/graph $dev $dir/decode_test || exit 1;
fi
# TODO : sequence training,
echo Success
exit 0
# Getting results [see RESULTS file]
# for x in exp/*/decode*; do [ -d $x ] && grep WER $x/wer_* | utils/best_wer.sh; done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment