-if [[ ! -f "${DYNCNN_RUNDIR}"/model_1000.t7 ]]; then
- cat <<EOF
-***************************************************************************
- Train the model (should take a while)
-***************************************************************************
-EOF
- ./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}"