Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Empty file modified egs/fisher_swbd/s5/local/chain/run_tdnn_lstm_1b.sh
100644 → 100755
Empty file.
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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} ${destdir}_speed1.0
if [ ! -f $srcdir/utt2uniq ]; then
cat $srcdir/utt2spk | awk '{printf("sp1.0-%s %s\n", $1, $1);}' > ${destdir}_speed1.0/utt2uniq
else
cat $srcdir/utt2uniq | awk '{printf("sp1.0-%s %s\n", $1, $2);}' > ${destdir}_speed1.0/utt2uniq
fi

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

rm -r ${destdir}_speed0.9 ${destdir}_speed1.1 ${destdir}_speed1.0

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