annotate experiments/scripts/cnbh-syllables/run_training_and_testing/test_features.sh @ 84:bee31e7ebf4b

- Added as-yet-unfinished support for a proper configuraiton file format - Added a couple of pythin scripts to generate HMM configuration files - Variable name changes and other cosmetic things - Added the option for the noise generation to do pink noise (untested)
author tomwalters
date Thu, 12 Aug 2010 11:28:11 +0000
parents 9c3cac29f300
children db8f7cf1f3e4
rev   line source
tomwalters@54 1 #!/bin/bash
tomwalters@54 2 #
tomwalters@54 3 # Train and test an HTK monophone model using AIM or MFCC
tomwalters@54 4 # features and the CNBH syllable databse
tomwalters@54 5 #
tomwalters@54 6 # Copyright 2009-2010 University of Cambridge
tomwalters@54 7 # Author: Thomas Walters <tom@acousticscale.org>
tomwalters@54 8 #
tomwalters@54 9 # Run multiple HMMs
tomwalters@54 10
tomwalters@54 11 set -e
tomwalters@54 12 set -u
tomwalters@54 13
tomwalters@54 14 WORKING_DIRECTORY=$1
tomwalters@54 15 FEATURE_SOURCE=$2
tomwalters@54 16 FEATURE_SUFFIX=$3
tomwalters@54 17 HMM_STATES_LIST=$4
tomwalters@54 18 MIXTURE_COMPONENTS_LIST=$5
tomwalters@54 19 TRAINING_ITERATIONS_LIST=$6
tomwalters@54 20 TESTING_ITERATIONS_LIST=$7
tomwalters@82 21 input_vector_size=$8
tomwalters@82 22 feature_code=$9
tomwalters@54 23
tomwalters@54 24 TRAIN_SPEAKERS=train_speakers
tomwalters@54 25 TEST_SPEAKERS=test_speakers
tomwalters@54 26
tomwalters@76 27 HMMCONFIG=hmm_configuration
tomwalters@54 28
tomwalters@82 29 THIS_DIR=`dirname $0`
tomwalters@54 30
tomwalters@83 31 if [ "$feature_code" == "MFCC_0_D_A" ]
tomwalters@54 32 then
tomwalters@82 33 cat <<"EOF" > $WORKING_DIRECTORY/$HMMCONFIG
tomwalters@54 34 # Coding parameters
tomwalters@54 35 SOURCEFORMAT= HTK
tomwalters@54 36 EOF
tomwalters@54 37 else
tomwalters@82 38 cat <<"EOF" > $WORKING_DIRECTORY/$HMMCONFIG
tomwalters@54 39 # Coding parameters
tomwalters@54 40 # The TARGETKIND and SOURCEKIND lines are to add deltas and delta-deltas to
tomwalters@54 41 # the AIM features
tomwalters@54 42 SOURCEFORMAT= HTK
tomwalters@54 43 SOURCEKIND= USER_E
tomwalters@54 44 TARGETKIND = USER_E_D_A
tomwalters@54 45 EOF
tomwalters@54 46 fi
tomwalters@54 47
tomwalters@76 48 for total_hmm_states in $HMM_STATES_LIST; do
tomwalters@76 49 for mixture_components in $MIXTURE_COMPONENTS_LIST; do
tomwalters@82 50 . $THIS_DIR/run_test_instance.sh &
tomwalters@54 51 done
tomwalters@54 52 done
tomwalters@54 53 echo "Waiting..."
tomwalters@54 54 wait
tomwalters@54 55