X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=mlp.git;a=blobdiff_plain;f=doit.sh;fp=doit.sh;h=bd6f195e75aa1b710fca74a3a0b0e3944a8766c1;hp=0000000000000000000000000000000000000000;hb=713c683d77fc94a4257c4031b0c51ef4669a3d4a;hpb=751279426fb49172dfe95d85dd277e06a970577e diff --git a/doit.sh b/doit.sh new file mode 100755 index 0000000..bd6f195 --- /dev/null +++ b/doit.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# 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 +# +# This file is part of mlp-mnist. +# +# mlp-mnist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# mlp-mnist is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with mlp-mnist. If not, see . + +make -k ann + +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 +fi + +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 "Found $f, good." + else + echo "File $f is missing. Try $0 --download-mnist." + exit 1 + fi +done + +./ann --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 \ + --data-files ./t10k-images-idx3-ubyte ./t10k-labels-idx1-ubyte \ + --nb-test-examples 10000