X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=run.sh;h=890c2e07009cef06c0742c5c2a3536e5a32e2627;hb=be0c7d53f21ce96c70e7c13ef0ba2c9eca10ca23;hp=d905ef996a22d739fbaf91bcab00dabdc15876f9;hpb=8e60c68637e79580cdefa53edf79a4804849997d;p=dyncnn.git diff --git a/run.sh b/run.sh index d905ef9..890c2e0 100755 --- a/run.sh +++ b/run.sh @@ -30,6 +30,9 @@ set -o pipefail [[ "${DYNCNN_DATA_DIR}" ]] || DYNCNN_DATA_DIR="./data/10p-mg" [[ "${DYNCNN_RESULT_DIR}" ]] || DYNCNN_RESULT_DIR="./results" +###################################################################### +# Create the data-set if needed + if [[ -d "${DYNCNN_DATA_DIR}" ]]; then echo "Found ${DYNCNN_DATA_DIR}, checking the number of images in there." if [[ $(find "${DYNCNN_DATA_DIR}" -name "dyn_*.png" | wc -l) == 150000 ]]; then @@ -48,21 +51,49 @@ else --dir "${DYNCNN_DATA_DIR}" fi -# Train the model (takes days) +###################################################################### +# Train the model (~30h on a GTX1080) if [[ ! -f "${DYNCNN_RESULT_DIR}"/epoch_01000_model ]]; then - ./dyncnn.lua --heavy --dataDir="${DYNCNN_DATA_DIR}" \ - --resultFreq=100 \ + ./dyncnn.lua --heavy --dataDir "${DYNCNN_DATA_DIR}" \ + --resultFreq 100 \ --resultDir "${DYNCNN_RESULT_DIR}" \ --nbEpochs 1000 fi +###################################################################### # Create the images of internal activations for n in 2 12; do - ./dyncnn.lua --heavy --dataDir=./data/10p-mg/ \ - --learningStateFile="${DYNCNN_RESULT_DIR}"/epoch_01000_model \ - --resultDir="${DYNCNN_RESULT_DIR}" \ + ./dyncnn.lua --heavy --dataDir ./data/10p-mg/ \ + --learningStateFile "${DYNCNN_RESULT_DIR}"/epoch_01000_model \ + --resultDir "${DYNCNN_RESULT_DIR}" \ --noLog \ - --exampleInternals=${n} + --exampleInternals ${n} done + +###################################################################### +# Plot the loss curves if gnuplot is here + +if [[ $(which gnuplot) ]]; then + echo "Plotting losses.pdf." + + TERMINAL="pdfcairo color transparent enhanced font \"Times,14\"" + EXTENSION="pdf" + + gnuplot <