From 952ebcb263f3cc75554da0e8b91f8a74be5786e2 Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Sun, 10 Mar 2019 10:53:17 +0530 Subject: [PATCH 1/7] Update perturb_data_dir_volume.sh --- .../s5/utils/data/perturb_data_dir_volume.sh | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh index dae440b03a3..f3227d1cc54 100755 --- a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh +++ b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh @@ -43,6 +43,26 @@ fi # foo-1 cat foo.wav | sox --vol 1.6 -t wav - -t wav - | # volume perturbation done # bar-1 sox --vol 1.2 bar.wav -t wav - | # volume perturbation done # foo-2 wav-reverberate --additive-signals="sox --vol=0.1 noise1.wav -t wav -|" foo.wav | # volume perturbation not done +# volume_perturb_done=`head -n100 $data/wav.scp | python -c " +# import sys, re +# for line in sys.stdin.readlines(): +# if len(line.strip()) == 0: +# continue +# # Handle three cases of rxfilenames appropriately; 'input piped command', 'file offset' and 'filename' +# parts = line.strip().split() +# if line.strip()[-1] == '|': +# if re.search('sox --vol', ' '.join(parts[-11:])): +# print 'true' +# sys.exit(0) +# elif re.search(':[0-9]+$', line.strip()) is not None: +# continue +# else: +# if ' '.join(parts[1:3]) == 'sox --vol': +# print 'true' +# sys.exit(0) +# print 'false' +# "` || exit 1 + volume_perturb_done=`head -n100 $data/wav.scp | python -c " import sys, re for line in sys.stdin.readlines(): @@ -52,17 +72,18 @@ for line in sys.stdin.readlines(): parts = line.strip().split() if line.strip()[-1] == '|': if re.search('sox --vol', ' '.join(parts[-11:])): - print 'true' + print("True") sys.exit(0) elif re.search(':[0-9]+$', line.strip()) is not None: continue else: if ' '.join(parts[1:3]) == 'sox --vol': - print 'true' + print("True") sys.exit(0) -print 'false' +print("False") "` || exit 1 +volume_perturb_done1=$volume_perturb_done | tr '[:upper:]' '[:lower:]' if $volume_perturb_done; then echo "$0: It looks like the data was already volume perturbed. Not doing anything." exit 0 From 254f2ee47114530583a50e57bea94563237790bf Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Sun, 10 Mar 2019 11:04:23 +0530 Subject: [PATCH 2/7] Update perturb_data_dir_volume.sh --- egs/wsj/s5/utils/data/perturb_data_dir_volume.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh index f3227d1cc54..7b9ff9b2e30 100755 --- a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh +++ b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh @@ -84,7 +84,7 @@ print("False") "` || exit 1 volume_perturb_done1=$volume_perturb_done | tr '[:upper:]' '[:lower:]' -if $volume_perturb_done; then +if $volume_perturb_done1; then echo "$0: It looks like the data was already volume perturbed. Not doing anything." exit 0 fi From 6d86a0cc77820f9e92ea458cb57942b61903653f Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Sun, 10 Mar 2019 11:15:31 +0530 Subject: [PATCH 3/7] Update run_tdnn_1g.sh --- egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh b/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh index 526059b7b90..90ced98f6ad 100755 --- a/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh +++ b/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh @@ -160,7 +160,8 @@ if [ $stage -le 15 ]; then echo "$0: creating neural net configs using the xconfig parser"; num_targets=$(tree-info $tree_dir/tree |grep num-pdfs|awk '{print $2}') - learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python) + # learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python) + learning_rate_factor=$(echo "print(0.5/$xent_regularize)" | python) tdnn_opts="l2-regularize=0.01 dropout-proportion=0.0 dropout-per-dim-continuous=true" tdnnf_opts="l2-regularize=0.01 dropout-proportion=0.0 bypass-scale=0.66" linear_opts="l2-regularize=0.01 orthonormal-constraint=-1.0" From 1fd0b0428dd13595d22e5436ecc31a6fa9541ec9 Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Mon, 11 Mar 2019 10:15:21 +0530 Subject: [PATCH 4/7] Update run_tdnn_1g.sh --- egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh b/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh index 90ced98f6ad..8f566ccfe6d 100755 --- a/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh +++ b/egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh @@ -160,7 +160,6 @@ if [ $stage -le 15 ]; then echo "$0: creating neural net configs using the xconfig parser"; num_targets=$(tree-info $tree_dir/tree |grep num-pdfs|awk '{print $2}') - # learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python) learning_rate_factor=$(echo "print(0.5/$xent_regularize)" | python) tdnn_opts="l2-regularize=0.01 dropout-proportion=0.0 dropout-per-dim-continuous=true" tdnnf_opts="l2-regularize=0.01 dropout-proportion=0.0 bypass-scale=0.66" From edc483b8a64857334e887c4cbe9f91d1f894e7f4 Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Mon, 11 Mar 2019 10:20:28 +0530 Subject: [PATCH 5/7] Update perturb_data_dir_volume.sh --- .../s5/utils/data/perturb_data_dir_volume.sh | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh index 7b9ff9b2e30..eb145cbab8a 100755 --- a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh +++ b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh @@ -43,26 +43,6 @@ fi # foo-1 cat foo.wav | sox --vol 1.6 -t wav - -t wav - | # volume perturbation done # bar-1 sox --vol 1.2 bar.wav -t wav - | # volume perturbation done # foo-2 wav-reverberate --additive-signals="sox --vol=0.1 noise1.wav -t wav -|" foo.wav | # volume perturbation not done -# volume_perturb_done=`head -n100 $data/wav.scp | python -c " -# import sys, re -# for line in sys.stdin.readlines(): -# if len(line.strip()) == 0: -# continue -# # Handle three cases of rxfilenames appropriately; 'input piped command', 'file offset' and 'filename' -# parts = line.strip().split() -# if line.strip()[-1] == '|': -# if re.search('sox --vol', ' '.join(parts[-11:])): -# print 'true' -# sys.exit(0) -# elif re.search(':[0-9]+$', line.strip()) is not None: -# continue -# else: -# if ' '.join(parts[1:3]) == 'sox --vol': -# print 'true' -# sys.exit(0) -# print 'false' -# "` || exit 1 - volume_perturb_done=`head -n100 $data/wav.scp | python -c " import sys, re for line in sys.stdin.readlines(): From 6d2349a62072f55891b3c35ccc38d14adaca89ad Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Tue, 12 Mar 2019 09:56:22 +0530 Subject: [PATCH 6/7] Update perturb_data_dir_volume.sh --- egs/wsj/s5/utils/data/perturb_data_dir_volume.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh index eb145cbab8a..d4f77519687 100755 --- a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh +++ b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh @@ -52,19 +52,19 @@ for line in sys.stdin.readlines(): parts = line.strip().split() if line.strip()[-1] == '|': if re.search('sox --vol', ' '.join(parts[-11:])): - print("True") + print('true') sys.exit(0) elif re.search(':[0-9]+$', line.strip()) is not None: continue else: if ' '.join(parts[1:3]) == 'sox --vol': - print("True") + print('true') sys.exit(0) -print("False") +print('false') "` || exit 1 -volume_perturb_done1=$volume_perturb_done | tr '[:upper:]' '[:lower:]' -if $volume_perturb_done1; then + +if $volume_perturb_done; then echo "$0: It looks like the data was already volume perturbed. Not doing anything." exit 0 fi From a4fe4a87f09a74e707ef9ecaff27711c851f7b13 Mon Sep 17 00:00:00 2001 From: Nikhil M Date: Tue, 12 Mar 2019 09:56:44 +0530 Subject: [PATCH 7/7] Update perturb_data_dir_volume.sh --- egs/wsj/s5/utils/data/perturb_data_dir_volume.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh index d4f77519687..e357ba8cbfb 100755 --- a/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh +++ b/egs/wsj/s5/utils/data/perturb_data_dir_volume.sh @@ -63,7 +63,6 @@ for line in sys.stdin.readlines(): print('false') "` || exit 1 - if $volume_perturb_done; then echo "$0: It looks like the data was already volume perturbed. Not doing anything." exit 0