Skip to content

Commit

Permalink
Fix speed-perturbatin for swbd + execuation permissions for some fish…
Browse files Browse the repository at this point in the history
…er_swbd scripts
  • Loading branch information
hhadian committed Feb 4, 2018
1 parent b4fbe00 commit 5d97afe
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 33 deletions.
Empty file modified egs/fisher_swbd/s5/local/chain/compare_wer_general.sh 100644 → 100755
Empty file.
Empty file modified egs/fisher_swbd/s5/local/chain/run_blstm_6h.sh 100644 → 100755
Empty file.
Empty file modified egs/fisher_swbd/s5/local/chain/run_blstm_6j.sh 100644 → 100755
Empty file.
Empty file modified egs/fisher_swbd/s5/local/chain/run_tdnn_7b.sh 100644 → 100755
Empty file.
Empty file modified egs/fisher_swbd/s5/local/chain/run_tdnn_lstm_1a.sh 100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions egs/fisher_swbd/s5/local/chain/run_tdnn_lstm_1b.sh 100644 → 100755
Expand Up @@ -28,8 +28,8 @@
# Final valid prob (xent) -0.9393 -0.9837

#./steps/info/chain_dir_info.pl exp/chain/tdnn_lstm_1b_sp
#exp/chain/tdnn_lstm_1b_sp: num-iters=1909 nj=3..16 num-params=39.7M dim=40+100->6149 combine=-0.087->-0.086 (over 5)
#xent:train/valid[1270,1908,final]=(-1.37,-1.02,-1.01/-1.31,-1.00,-0.984)
#exp/chain/tdnn_lstm_1b_sp: num-iters=1909 nj=3..16 num-params=39.7M dim=40+100->6149 combine=-0.087->-0.086 (over 5)
#xent:train/valid[1270,1908,final]=(-1.37,-1.02,-1.01/-1.31,-1.00,-0.984)
#logprob:train/valid[1270,1908,final]=(-0.108,-0.088,-0.087/-0.103,-0.091,-0.088)


Expand Down Expand Up @@ -108,7 +108,7 @@ dir=${dir}$suffix
build_tree_train_set=train_nodup
train_set=train_nodup_sp
build_tree_ali_dir=exp/tri5a_ali
treedir=exp/chain/tri6_tree
treedir=exp/chain/tri5_tree
lang=data/lang_chain

# if we are using the speed-perturbed data we need to generate
Expand Down
Empty file modified egs/fisher_swbd/s5/local/chain/run_tdnn_opgru_1a.sh 100644 → 100755
Empty file.
Empty file modified egs/fisher_swbd/s5/local/chain/run_tdnn_opgru_1b.sh 100644 → 100755
Empty file.
45 changes: 17 additions & 28 deletions egs/swbd/s5c/local/nnet3/run_ivector_common.sh
Expand Up @@ -4,49 +4,38 @@
set -e
stage=1
train_stage=-10
generate_alignments=true # false if doing ctc training
generate_alignments=true
speed_perturb=true

. ./path.sh
. ./utils/parse_options.sh

mkdir -p nnet3
# perturbed data preparation
mkdir -p exp/nnet3
train_set=train_nodup

if [ -e data/rt03 ]; then maybe_rt03=rt03; else maybe_rt03= ; fi

if [ "$speed_perturb" == "true" ]; then
if $speed_perturb; then
if [ $stage -le 1 ]; then
#Although the nnet will be trained by high resolution data, we still have to perturbe the normal data to get the alignment
# Although the nnet will be trained by high resolution data, we still have to perturb the normal data to get the alignments
# _sp stands for speed-perturbed

for datadir in train_nodup; do
utils/perturb_data_dir_speed.sh 0.9 data/${datadir} data/temp1
utils/perturb_data_dir_speed.sh 1.1 data/${datadir} data/temp2
utils/combine_data.sh data/${datadir}_tmp data/temp1 data/temp2
utils/validate_data_dir.sh --no-feats data/${datadir}_tmp
rm -r data/temp1 data/temp2

mfccdir=mfcc_perturbed
steps/make_mfcc.sh --cmd "$train_cmd" --nj 50 \
data/${datadir}_tmp exp/make_mfcc/${datadir}_tmp $mfccdir || exit 1;
steps/compute_cmvn_stats.sh data/${datadir}_tmp exp/make_mfcc/${datadir}_tmp $mfccdir || exit 1;
utils/fix_data_dir.sh data/${datadir}_tmp

utils/copy_data_dir.sh --spk-prefix sp1.0- --utt-prefix sp1.0- data/${datadir} data/temp0
utils/combine_data.sh data/${datadir}_sp data/${datadir}_tmp data/temp0
utils/fix_data_dir.sh data/${datadir}_sp
rm -r data/temp0 data/${datadir}_tmp
done
echo "$0: preparing directory for speed-perturbed data"
utils/data/perturb_data_dir_speed_3way.sh data/${train_set} data/${train_set}_sp

echo "$0: creating MFCC features for low-resolution speed-perturbed data"
mfccdir=mfcc_perturbed
steps/make_mfcc.sh --cmd "$train_cmd" --nj 50 \
data/${train_set}_sp exp/make_mfcc/${train_set}_sp $mfccdir
steps/compute_cmvn_stats.sh data/${train_set}_sp exp/make_mfcc/${train_set}_sp $mfccdir
utils/fix_data_dir.sh data/${train_set}_sp
fi

if [ $stage -le 2 ] && [ "$generate_alignments" == "true" ]; then
#obtain the alignment of the perturbed data
if [ $stage -le 2 ] && $generate_alignments; then
# obtain the alignment of the perturbed data
steps/align_fmllr.sh --nj 100 --cmd "$train_cmd" \
data/train_nodup_sp data/lang exp/tri4 exp/tri4_ali_nodup_sp || exit 1
data/${train_set}_sp data/lang exp/tri4 exp/tri4_ali_nodup_sp
fi
train_set=train_nodup_sp
train_set=${train_set}_sp
fi

if [ $stage -le 3 ]; then
Expand Down
12 changes: 10 additions & 2 deletions egs/wsj/s5/utils/data/perturb_data_dir_speed_3way.sh
Expand Up @@ -38,9 +38,17 @@ utils/data/get_utt2dur.sh ${srcdir}

utils/data/perturb_data_dir_speed.sh 0.9 ${srcdir} ${destdir}_speed0.9 || exit 1
utils/data/perturb_data_dir_speed.sh 1.1 ${srcdir} ${destdir}_speed1.1 || exit 1
utils/data/combine_data.sh $destdir ${srcdir} ${destdir}_speed0.9 ${destdir}_speed1.1 || exit 1

rm -r ${destdir}_speed0.9 ${destdir}_speed1.1
utils/copy_data_dir.sh --spk-prefix sp1.0- --utt-prefix sp1.0- ${srcdir} data/temp0
if [ ! -f $srcdir/utt2uniq ]; then
cat $srcdir/utt2spk | awk '{printf("sp1.0-%s %s\n", $1, $1);}' > data/temp0/utt2uniq
else
cat $srcdir/utt2uniq | awk '{printf("sp1.0-%s %s\n", $1, $2);}' > data/temp0/utt2uniq
fi

utils/data/combine_data.sh $destdir data/temp0 ${destdir}_speed0.9 ${destdir}_speed1.1 || exit 1

rm -r ${destdir}_speed0.9 ${destdir}_speed1.1 data/temp0

echo "$0: generated 3-way speed-perturbed version of data in $srcdir, in $destdir"
utils/validate_data_dir.sh --no-feats --no-text $destdir

0 comments on commit 5d97afe

Please sign in to comment.