3 #########################################################################
4 # This program is free software: you can redistribute it and/or modify #
5 # it under the terms of the version 3 of the GNU General Public License #
6 # as published by the Free Software Foundation. #
8 # This program is distributed in the hope that it will be useful, but #
9 # WITHOUT ANY WARRANTY; without even the implied warranty of #
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
11 # General Public License for more details. #
13 # You should have received a copy of the GNU General Public License #
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
16 # Written by Francois Fleuret, (C) IDIAP #
17 # Contact <francois.fleuret@idiap.ch> for comments & bug reports #
18 #########################################################################
20 MAIN_URL="http://www.idiap.ch/folded-ctf"
26 if [[ $? != 0 ]]; then
27 echo "Compilation failed." >&2
33 ######################################################################
34 # Generating the pool file
37 POOL_NAME=${DATA_PATH}/rmk.pool
39 if [[ -d ${DATA_PATH} ]]; then
41 if [[ -f ${POOL_NAME} ]]; then
43 echo "The pool file exists."
47 echo "Can not find the pool file, checking the data integrity."
49 md5sum -c ${DATA_PATH}/list.md5
51 if [[ $? != 0 ]]; then
52 echo "The data set is corrupted. You can download it" >&2
53 echo "from ${MAIN_URL}" >&2
57 echo "Generating the pool file."
59 ./list_to_pool ${DATA_PATH}/full.lst ${DATA_PATH} ${POOL_NAME}.wrk
61 if [[ $? == 0 ]]; then
62 mv ${POOL_NAME}.wrk ${POOL_NAME}
64 \rm ${POOL_NAME}.wrk 2> /dev/null
65 echo "Pool generation failed." >&2
73 echo "Can not find the RateMyKitten images in ${DATA_PATH}. You can download" >&2
74 echo "them from ${MAIN_URL}" >&2
79 ######################################################################
80 # Running the computation per se
84 if [[ ! -d ${RESULT_DIR} ]]; then
88 for SEED in {0..9}; do
90 for MODE in hb h+b; do
92 EXPERIMENT_RESULT_DIR="${RESULT_DIR}/${MODE}-${SEED}"
94 mkdir ${EXPERIMENT_RESULT_DIR} 2> /dev/null
96 if [[ $? == 0 ]]; then
98 OPTS="--random-seed=${SEED} --wanted-true-positive-rate=0.75"
100 if [[ $MODE == "h+b" ]]; then
101 OPTS="${OPTS} --force-head-belly-independence=yes"
104 if [[ $1 == "light" ]]; then
105 OPTS="${OPTS} --nb-classifiers-per-level=1 --nb-weak-learners-per-classifier=10"
106 OPTS="${OPTS} --proportion-for-train=0.1 --proportion-for-validation=0.1 --proportion-for-test=0.1"
111 --pool-name=${POOL_NAME} \
113 --nb-classifiers-per-level=25 --nb-weak-learners-per-classifier=100 \
114 --result-path=${EXPERIMENT_RESULT_DIR} \
115 --detector-name=${EXPERIMENT_RESULT_DIR}/default.det \
121 sequence-test-detector | tee -a ${EXPERIMENT_RESULT_DIR}/stdout
125 echo "${EXPERIMENT_RESULT_DIR} exists, aborting experiment."