Added #include <unistd.h> for nice().
[mlp.git] / doit.sh
diff --git a/doit.sh b/doit.sh
index bd6f195..60a8311 100755 (executable)
--- a/doit.sh
+++ b/doit.sh
@@ -2,8 +2,10 @@
 
 #  mlp-mnist is an implementation of a multi-layer neural network.
 #
-#  Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/
-#  Written by Francois Fleuret <francois.fleuret@idiap.ch>
+#  Copyright (c) 2006 École Polytechnique Fédérale de Lausanne,
+#  http://www.epfl.ch
+#
+#  Written by Francois Fleuret <francois@fleuret.org>
 #
 #  This file is part of mlp-mnist.
 #
 #  You should have received a copy of the GNU General Public License
 #  along with mlp-mnist.  If not, see <http://www.gnu.org/licenses/>.
 
-make -k ann
+make -k mlp
+
+if [[ $1 ]]; then
+
+    if [[ $1 == "--download-mnist" ]]; then
+        for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte; do
+            if [[ ! -f "./$f" ]]; then
+                echo "Could not find $f, downloading it."
+                wget http://yann.lecun.com/exdb/mnist/$f.gz
+                gunzip $f.gz
+            fi
+        done
+    else
 
-if [[ $1 == "--download-mnist" ]]; then
-    for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte; do
-        if [[ ! -f "./$f" ]]; then
-            echo "Could not find $f, downloading it."
-            wget http://yann.lecun.com/exdb/mnist/$f.gz
-            gunzip $f.gz
-        fi
-    done
+        echo "Unknown option $1"
+        exit 1
+
+    fi
 fi
 
 for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte; do
@@ -40,11 +50,13 @@ for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte
     fi
 done
 
-./ann --nb-training-examples 20000 --nb-validation-examples 20000 \
+./mlp \
+    --nb-training-examples 20000 --nb-validation-examples 20000 \
     --mlp-structure 784,200,10 \
     --data-files ./train-images-idx3-ubyte ./train-labels-idx1-ubyte \
     --save-mlp simple.mlp
 
-./ann --load-mlp simple.mlp \
+./mlp \
+    --load-mlp simple.mlp \
     --data-files ./t10k-images-idx3-ubyte ./t10k-labels-idx1-ubyte \
     --nb-test-examples 10000