[[ "${DYNCNN_DATA_DIR}" ]] || DYNCNN_DATA_DIR="./data/10p-mg"
[[ "${DYNCNN_RUNDIR}" ]] || DYNCNN_RUNDIR="./results"
+NB_EPOCHS=2000
+
if [[ ! -d "${DYNCNN_DATA_DIR}" ]]; then
# Creating the data-base
make -j -k
# Train the model (2000 epochs takes 30h on a GTX 1080 with cuda 8.0,
# cudnn 5.1, and recent torch)
-if [[ ! -f "${DYNCNN_RUNDIR}"/scheme_02000.t7 ]]; then
- ./dyncnn.lua -rundir "${DYNCNN_RUNDIR}"
+if [[ -f "$(printf "%s/model_%04d.t7" "${DYNCNN_RUNDIR}" ${NB_EPOCHS})" ]]; then
+ echo "Found the model already trained through ${NB_EPOCHS} epochs."
+else
+ ./dyncnn.lua -nbEpochs ${NB_EPOCHS} -rundir "${DYNCNN_RUNDIR}"
fi
# Create the images of internal activations using the current.t7 in
# the rundir
+ cat <<EOF
+***************************************************************************
+ Creates the images of internal activations
+***************************************************************************
+EOF
+
./dyncnn.lua -rundir "${DYNCNN_RUNDIR}" -noLog -exampleInternals 3,7
######################################################################
if [[ $(which gnuplot) ]]; then
cat <<EOF
***************************************************************************
- Plot the loss curves
+ Plots the loss curves
***************************************************************************
EOF
set size ratio 0.75
set xlabel "Number of epochs"
set ylabel "Loss"
-plot '< grep "LOSS " "${DYNCNN_RUNDIR}"/log' using 4:6 with l lw 3 lc rgb '#c0c0ff' title 'Validation loss',\
- '< grep "LOSS " "${DYNCNN_RUNDIR}"/log' using 4:5 with l lw 1 lc rgb '#000000' title 'Train loss'
+plot '< grep "acc_train_loss" "${DYNCNN_RUNDIR}"/log' using 4:8 with l lw 3 lc rgb '#c0c0ff' title 'Validation loss',\
+ '< grep "acc_train_loss" "${DYNCNN_RUNDIR}"/log' using 4:6 with l lw 1 lc rgb '#000000' title 'Train loss'
EOF