annotate experiments/scripts/master.sh @ 171:884f10293296

- AWS changes (part 3)
author tomwalters
date Wed, 11 Aug 2010 09:11:07 +0000
parents df9b49dba8fa
children effb9f6052f1
rev   line source
tomwalters@54 1 #!/bin/bash
tomwalters@54 2 # Copyright 2010 Thomas Walters <tom@acousticscale.org>
tomwalters@54 3 #
tomwalters@54 4 # Run a series of experiments which compare MFCC features generated by HTK to
tomwalters@54 5 # AIM features generated using AIM-C using a series of syllable recogntiton
tomwalters@54 6 # tasks.
tomwalters@165 7 # This script expects the HTK binaries and AIM-C AIMCopy binary to be present
tomwalters@165 8 # in the PATH.
tomwalters@128 9
tomwalters@54 10 # Set these to be the location of your input database, and desired output
tomwalters@165 11 # locations.
tomwalters@165 12 SYLLABLES_DATABASE_TAR=/media/sounds/cnbh-syllables.tar
tomwalters@165 13 SOUNDS_ROOT=/mnt/experiments/sounds/
tomwalters@165 14 FEATURES_ROOT=/mnt/experiments/features/
tomwalters@165 15 HMMS_ROOT=/mnt/experiments/hmms/
tomwalters@128 16
tomwalters@54 17 # Number of cores on the experimental machine. Various scripts will try to use
tomwalters@54 18 # this if it's set.
tomwalters@165 19 NUMBER_OF_CORES=2
tomwalters@54 20
tomwalters@54 21 # Fail if any command fails
tomwalters@54 22 set -e
tomwalters@54 23
tomwalters@54 24 # Fail if any variable is unset
tomwalters@54 25 set -u
tomwalters@54 26
tomwalters@54 27 if [ ! -d $SOUNDS_ROOT ]; then
tomwalters@169 28 sudo mkdir -p $SOUNDS_ROOT
tomwalters@169 29 sudo chown `whoami` $SOUNDS_ROOT
tomwalters@54 30 fi
tomwalters@54 31
tomwalters@165 32 # Untar the CNBH syllables database, and convert the files from FLAC to WAV
tomwalters@54 33 if [ ! -e $SOUNDS_ROOT/.untar_db_success ]; then
tomwalters@54 34 tar -x -C $SOUNDS_ROOT -f $SYLLABLES_DATABASE_TAR
tomwalters@54 35 touch $SOUNDS_ROOT/.untar_db_success
tomwalters@54 36 fi
tomwalters@54 37
tomwalters@54 38 # Convert the database to .WAV format and place it in $SOUNDS_ROOT/clean
tomwalters@171 39 ./cnbh-syllables/feature_generation/convert_flac_to_wav.sh $SOUNDS_ROOT
tomwalters@54 40
tomwalters@54 41 # Generate versions of the CNBH syllables spoke pattern with a range of
tomwalters@54 42 # signal-to-noise ratios (SNRs). The versions are put in the directory
tomwalters@54 43 # ${SOUNDS_ROOT}/${SNR}_dB/ for each SNR in $SNRS.
tomwalters@165 44 SNRS="30 27 24 21 18 15 12 9 6 3 0"
tomwalters@170 45 ./cnbh-syllables/feature_generation/pink_noise.sh $SOUNDS_ROOT/clean/ $SNRS
tomwalters@54 46
tomwalters@54 47 # Make the list of all feature drectories
tomwalters@165 48 FEATURE_DIRS="clean"
tomwalters@54 49 for SNR in $SNRS; do
tomwalters@54 50 FEATURE_DIRS="$FEATURE_DIRS snr_${SNR}dB"
tomwalters@54 51 done
tomwalters@54 52
tomwalters@54 53 # Generate feature sets (for the full range of SNRs in $FEATURE_DIRS)
tomwalters@54 54 # 1. Standard MFCC features
tomwalters@54 55 # 2. AIM features
tomwalters@165 56 # 3. MFCC features with optimal VTLN
tomwalters@169 57
tomwalters@169 58
tomwalters@169 59 if [ ! -d $FEATURES_ROOT ]; then
tomwalters@169 60 sudo mkdir -p $FEATURES_ROOT
tomwalters@169 61 sudo chown `whoami` $FEATURES_ROOT
tomwalters@169 62 fi
tomwalters@169 63
tomwalters@54 64 for SOURCE_SNR in $FEATURE_DIRS; do
tomwalters@165 65
tomwalters@165 66 if [ ! -e $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success]
tomwalters@165 67 then
tomwalters@54 68 mkdir -p $FEATURES_ROOT/mfcc/$SOURCE_SNR/
tomwalters@54 69 # Generate the list of files to convert
tomwalters@165 70 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
tomwalters@54 71 # Run the conversion
tomwalters@101 72 ./cnbh-syllables/feature_generation/run_hcopy.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $NUMBER_OF_CORES
tomwalters@101 73 touch $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success
tomwalters@165 74 done
tomwalters@54 75
tomwalters@165 76 if [ ! -e $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success]
tomwalters@165 77 then
tomwalters@54 78 mkdir -p $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/
tomwalters@54 79 # Generate the file list and run the conversion (all one step, since this
tomwalters@165 80 # version uses a different configuraiton for each talker)
tomwalters@101 81 ./cnbh-syllables/feature_generation/run_mfcc_vtln_conversion.sh $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
tomwalters@101 82 touch $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success
tomwalters@165 83 done
tomwalters@54 84
tomwalters@165 85 if [ ! -e $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success]
tomwalters@165 86 then
tomwalters@165 87 mkdir -p $FEATURES_ROOT/aim/$SOURCE_SNR/
tomwalters@165 88 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
tomwalters@54 89 # Run the conversion
tomwalters@165 90 ./cnbh-syllables/feature_generation/run_aimcopy.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $NUMBER_OF_CORES
tomwalters@98 91 touch $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success
tomwalters@165 92 done
tomwalters@165 93 done
tomwalters@82 94
tomwalters@54 95 # Now run a bunch of experiments.
tomwalters@54 96 # For each of the feature types, we want to run HMMs with a bunch of
tomwalters@54 97 # parameters.
tomwalters@165 98 TRAINING_ITERATIONS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
tomwalters@165 99 TESTING_ITERATIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
tomwalters@165 100 HMM_STATES="3 4 5 6 7 8"
tomwalters@165 101 HMM_OUTPUT_COMPONENTS=""
tomwalters@91 102
tomwalters@93 103