comparison trunk/experiments/scripts/master.sh @ 382:068e33a65f8d

- Pretty-plotting - Test on everything - Generalised beyond standard AMI
author tomwalters
date Tue, 14 Sep 2010 00:18:47 +0000
parents e6f006238034
children 040a07935a28
comparison
equal deleted inserted replaced
381:e6f006238034 382:068e33a65f8d
3 # 3 #
4 # Run a series of experiments which compare MFCC features generated by HTK to 4 # Run a series of experiments which compare MFCC features generated by HTK to
5 # AIM features generated using AIM-C using a series of syllable recogntiton 5 # AIM features generated using AIM-C using a series of syllable recogntiton
6 # tasks. 6 # tasks.
7 # This script expects to be run from within the AIM-C source tree. 7 # This script expects to be run from within the AIM-C source tree.
8 # It builds the HTK binaries and AIM-C AIMCopy binary if they're not 8 # It builds the HTK binaries and AIM-C AIMCopy binary if they're not
9 # present. 9 # present.
10 # The following environment varaibles should be set before this script is run: 10 # The following environment varaibles should be set before this script is run:
11 # SYLLABLES_DATABASE_URL - URL of a tar file containing the CNBH syllables 11 # SYLLABLES_DATABASE_URL - URL of a tar file containing the CNBH syllables
12 # database in FLAC format 12 # database in FLAC format
13 # HTK_USERNAME and HTK_PASSWORD - username and password for the site at 13 # HTK_USERNAME and HTK_PASSWORD - username and password for the site at
14 # http://htk.eng.cam.ac.uk/ 14 # http://htk.eng.cam.ac.uk/
15 # NUMBER_OF_CORES - total number of machine cores 15 # NUMBER_OF_CORES - total number of machine cores
16 16
17 # Set these to be the location of your input database, and desired output 17 # Set these to be the location of your input database, and desired output
18 # locations. 18 # locations. (Note: the user running this script needs write permissions on
19 SYLLABLES_DATABASE_TAR=/mnt/sounds/cnbh-syllables.tar 19 # the $WORKING_VOLUME.)
20 SOUNDS_ROOT=/mnt/experiments/sounds/ 20 WORKING_VOLUME=/mnt/scratch1
21 FEATURES_ROOT=/mnt/experiments/features/ 21
22 HMMS_ROOT=/mnt/experiments/hmms/ 22 SYLLABLES_DATABASE_TAR=$WORKING_VOLUME/001-downloaded_sounds_data/cnbh-syllables.tar
23 SOUNDS_ROOT=$WORKING_VOLUME/002-sounds/
24 FEATURES_ROOT=$WORKING_VOLUME/003-features/
25 HMMS_ROOT=$WORKING_VOLUME/004-hmms/
26 HTK_ROOT=$WORKING_VOLUME/software/htk/
27 AIMC_ROOT=$WORKING_VOLUME/software/aimc/
23 28
24 # Number of cores on the experimental machine. Various scripts will try to use 29 # Number of cores on the experimental machine. Various scripts will try to use
25 # this if it's set. 30 # this if it's set.
26 # NUMBER_OF_CORES=8 31 # NUMBER_OF_CORES=8
27 32
29 set -e 34 set -e
30 35
31 # Fail if any variable is unset 36 # Fail if any variable is unset
32 set -u 37 set -u
33 38
39 ######
40 # Step 001 - Get the sounds database
34 if [ ! -e $SYLLABLES_DATABASE_TAR ]; then 41 if [ ! -e $SYLLABLES_DATABASE_TAR ]; then
35 sudo mkdir -p `dirname $SYLLABLES_DATABASE_TAR` 42 mkdir -p `dirname $SYLLABLES_DATABASE_TAR`
36 sudo chown `whoami` `dirname $SYLLABLES_DATABASE_TAR`
37 wget -O $SYLLABLES_DATABASE_TAR $SYLLABLES_DATABASE_URL 43 wget -O $SYLLABLES_DATABASE_TAR $SYLLABLES_DATABASE_URL
38 fi 44 fi
39 45
40 if [ ! -d $SOUNDS_ROOT ]; then 46 if [ ! -d $SOUNDS_ROOT ]; then
41 sudo mkdir -p $SOUNDS_ROOT 47 mkdir -p $SOUNDS_ROOT
42 sudo chown `whoami` $SOUNDS_ROOT 48 fi
43 fi 49
44 50 # Untar the CNBH syllables database, and convert the files from FLAC to WAV.
45 # Untar the CNBH syllables database, and convert the files from FLAC to WAV
46 if [ ! -e $SOUNDS_ROOT/.untar_db_success ]; then 51 if [ ! -e $SOUNDS_ROOT/.untar_db_success ]; then
47 tar -x -C $SOUNDS_ROOT -f $SYLLABLES_DATABASE_TAR 52 tar -x -C $SOUNDS_ROOT -f $SYLLABLES_DATABASE_TAR
48 touch $SOUNDS_ROOT/.untar_db_success 53 touch $SOUNDS_ROOT/.untar_db_success
49 fi 54 fi
50 55
51 # Convert the database to .WAV format and place it in $SOUNDS_ROOT/clean 56 # Convert the database to .WAV format and place it in $SOUNDS_ROOT/clean
52 echo "Converting CNBH-syllables database from FLAC to WAV..." 57 echo "Converting CNBH-syllables database from FLAC to WAV..."
53 ./cnbh-syllables/feature_generation/convert_flac_to_wav.sh $SOUNDS_ROOT 58 ./cnbh-syllables/feature_generation/convert_flac_to_wav.sh $SOUNDS_ROOT
54 59 #
60 ######
61
62 #####
63 # Step 002 -
55 # Generate versions of the CNBH syllables spoke pattern with a range of 64 # Generate versions of the CNBH syllables spoke pattern with a range of
56 # signal-to-noise ratios (SNRs). The versions are put in the directory 65 # signal-to-noise ratios (SNRs). The versions are put in the directory
57 # ${SOUNDS_ROOT}/${SNR}_dB/ for each SNR in $SNRS. 66 # ${SOUNDS_ROOT}/${SNR}_dB/ for each SNR in $SNRS.
58 SNRS="30 27 24 21 18 15 12 9 6 3 0" 67 SNRS="30 27 24 21 18 15 12 9 6 3 0"
59 #SNRS="30" # For testing 68 #SNRS="30" # For testing
66 done 75 done
67 76
68 # Generate feature sets (for the full range of SNRs in $FEATURE_DIRS) 77 # Generate feature sets (for the full range of SNRs in $FEATURE_DIRS)
69 # 1. Standard MFCC features 78 # 1. Standard MFCC features
70 # 2. AIM features 79 # 2. AIM features
71 # 3. MFCC features with optimal VTLN 80 # 3. MFCC features with optimal VTLN
72
73 81
74 if [ ! -d $FEATURES_ROOT ]; then 82 if [ ! -d $FEATURES_ROOT ]; then
75 sudo mkdir -p $FEATURES_ROOT 83 mkdir -p $FEATURES_ROOT
76 sudo chown `whoami` $FEATURES_ROOT 84 fi
77 fi 85
78 86 if [ ! -e $HTK_ROOT/.htk_installed_success ]; then
79 if [ ! -e /mnt/experiments/htk/.htk_installed_success ]; then 87 ./HTK/install_htk.sh $HTK_ROOT
80 ./HTK/install_htk.sh 88 fi
81 fi 89
82 90 if [ ! -e $AIMC_ROOT/.aimc_build_success ]; then
83 if [ ! -e /mnt/experiments/aimc/.aimc_build_success ]; then 91 ./aimc/build_aimc.sh $AIMC_ROOT
84 # ./aimc/build_aimc.sh
85 cd ../../
86 scons
87 export PATH=$PATH:`pwd`/build/posix-release/
88 cd -
89 fi 92 fi
90 93
91 for SOURCE_SNR in $FEATURE_DIRS; do 94 for SOURCE_SNR in $FEATURE_DIRS; do
92
93 if [ ! -e $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success ]; then 95 if [ ! -e $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success ]; then
94 mkdir -p $FEATURES_ROOT/mfcc/$SOURCE_SNR/ 96 mkdir -p $FEATURES_ROOT/mfcc/$SOURCE_SNR/
95 # Generate the list of files to convert 97 # Generate the list of files to convert
96 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/ htk 98 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/ htk
97 # Run the conversion 99 # Run the conversion
98 #./cnbh-syllables/feature_generation/run_hcopy.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $NUMBER_OF_CORES 100 ./cnbh-syllables/feature_generation/run_hcopy.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $NUMBER_OF_CORES
99 #touch $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success 101 touch $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success
100 fi 102 fi
101 103
102 if [ ! -e $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success ]; then 104 if [ ! -e $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success ]; then
103 mkdir -p $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/ 105 mkdir -p $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/
104 # Generate the file list and run the conversion (all one step, since this 106 # Generate the file list and run the conversion (all one step, since this
105 # version uses a different configuration for each talker) 107 # version uses a different configuration for each talker)
106 #./cnbh-syllables/feature_generation/run_mfcc_vtln_conversion.sh $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/ 108 ./cnbh-syllables/feature_generation/run_mfcc_vtln_conversion.sh $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
107 #touch $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success 109 touch $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success
108 fi 110 fi
109 111
110 if [ ! -e $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success ]; then 112 if [ ! -e $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success ]; then
111 mkdir -p $FEATURES_ROOT/aim/$SOURCE_SNR/ 113 mkdir -p $FEATURES_ROOT/aim/$SOURCE_SNR/
112 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/ "" 114 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/ ""
113 # Run the conversion 115 # Run the conversion
114 ./cnbh-syllables/feature_generation/run_aimcopy.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $NUMBER_OF_CORES 116 ./cnbh-syllables/feature_generation/run_aimcopy.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $NUMBER_OF_CORES
115 touch $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success 117 touch $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success
116 fi 118 fi
117 done 119 done
118 120
119 sudo mkdir -p $HMMS_ROOT 121 mkdir -p $HMMS_ROOT
120 sudo chown `whoami` $HMMS_ROOT
121 122
122 # Now run a bunch of experiments. 123 # Now run a bunch of experiments.
123 # For each of the feature types, we want to run HMMs with a bunch of 124 # For each of the feature types, we want to run HMMs with a bunch of
124 # parameters. 125 # parameters.
125 TRAINING_ITERATIONS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20" 126 TRAINING_ITERATIONS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" # 16 17 18 19 20"
126 TESTING_ITERATIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20" 127 #TESTING_ITERATIONS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
127 HMM_STATES="3 4 5 6 7 8" 128 TESTING_ITERATIONS="15"
128 HMM_OUTPUT_COMPONENTS="1 2 3 4 5 6 7" 129 #HMM_STATES="3 4 5 6 7 8"
129 130 HMM_STATES="4"
130 return 0 131 #HMM_OUTPUT_COMPONENTS="1 2 3 4 5 6 7"
132 HMM_OUTPUT_COMPONENTS="4"
131 133
132 run_train_test () { 134 run_train_test () {
133 # TODO(tom): Make sure that the training SNR is generated first 135 # TODO(tom): Make sure that the training SNR is generated first
134 for SOURCE_SNR in $FEATURE_DIRS; do 136 for SOURCE_SNR in $FEATURE_DIRS; do
135 WORK=$HMMS_ROOT/$FEATURE_CLASS/$FEATURE_SUFFIX/$SOURCE_SNR/$TALKERS/ 137 WORK=$HMMS_ROOT/$FEATURE_CLASS/$FEATURE_SUFFIX/$SOURCE_SNR/$TALKERS/
165 "$TRAINING_MASTER_LABEL_FILE" \ 167 "$TRAINING_MASTER_LABEL_FILE" \
166 "$TESTING_MASTER_LABEL_FILE" 168 "$TESTING_MASTER_LABEL_FILE"
167 done 169 done
168 } 170 }
169 171
170
171 ######################## 172 ########################
172 # Standard MFCCs 173 # Standard MFCCs
173 FEATURE_CLASS=mfcc 174 FEATURE_CLASS=mfcc
174 FEATURE_SUFFIX=htk 175 FEATURE_SUFFIX=htk
175 FEATURE_SIZE=39 176 FEATURE_SIZE=39
212 TALKERS=outer_talkers 213 TALKERS=outer_talkers
213 TRAINING_SNR=clean 214 TRAINING_SNR=clean
214 run_train_test 215 run_train_test
215 ######################## 216 ########################
216 217
218 AIM_FEATURE_SUFFIXES="slice_1_no_cutoff ssi_profile_no_cutoff slice_1_cutoff ssi_profile_cutoff smooth_nap_profile"
219 for f in $AIM_FEATURE_SUFFIXES
220 do
217 ######################## 221 ########################
218 # AIM Features 222 # AIM Features
219 # TODO (loop over all feature suffixes) 223 # Inner talkers
220 ######################## 224 FEATURE_CLASS=aim
221 225 FEATURE_SUFFIX=$f
222 226 FEATURE_SIZE=12
223 227 FEATURE_TYPE=USER_E_D_A
224 228 TALKERS=inner_talkers
225 229 TRAINING_SNR=clean
230 run_train_test
231 ########################
232
233 ########################
234 # AIM Features
235 # Inner talkers
236 FEATURE_CLASS=aim
237 FEATURE_SUFFIX=$f
238 FEATURE_SIZE=12
239 FEATURE_TYPE=USER_E_D_A
240 TALKERS=outer_talkers
241 TRAINING_SNR=clean
242 run_train_test
243 ########################
244 done
245
246
247
248