3 # mlp-mnist is an implementation of a multi-layer neural network.
5 # Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/
6 # Written by Francois Fleuret <francois.fleuret@idiap.ch>
8 # This file is part of mlp-mnist.
10 # mlp-mnist is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License version 3 as
12 # published by the Free Software Foundation.
14 # mlp-mnist is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with mlp-mnist. If not, see <http://www.gnu.org/licenses/>.
24 if [[ $1 == "--download-mnist" ]]; then
25 for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte; do
26 if [[ ! -f "./$f" ]]; then
27 echo "Could not find $f, downloading it."
28 wget http://yann.lecun.com/exdb/mnist/$f.gz
34 for f in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte; do
35 if [[ -f "./$f" ]]; then
36 echo "Found $f, good."
38 echo "File $f is missing. Try $0 --download-mnist."
43 ./ann --nb-training-examples 20000 --nb-validation-examples 20000 \
44 --mlp-structure 784,200,10 \
45 --data-files ./train-images-idx3-ubyte ./train-labels-idx1-ubyte \
48 ./ann --load-mlp simple.mlp \
49 --data-files ./t10k-images-idx3-ubyte ./t10k-labels-idx1-ubyte \
50 --nb-test-examples 10000