-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
do-mnist11png-train
executable file
·29 lines (25 loc) · 1.24 KB
/
do-mnist11png-train
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/zsh
test -e train-images-idx3-ubyte.gz || {
echo "ERROR: you need to download train-image-idx3-ubyte.gz" 1>&2
echo "ERROR: from http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz" 1>&2
exit 1
}
test -e train-labels-idx1-ubyte.gz || {
echo "ERROR: you need to download train-labels-idx1-ubyte.gz" 1>&2
echo "ERROR: from http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz" 1>&2
exit 1
}
SHUFFLE='BEGIN { srand 69; };
$i = int rand 1000;
print $b[$i] if $b[$i];
$b[$i] = $_; } { print grep { defined $_ } @b;'
paste -d' ' \
<(gunzip -c train-labels-idx1-ubyte.gz | ./extract-labels) \
<(gunzip -c train-images-idx3-ubyte.gz | ./extractpixels) | \
perl -ne ${SHUFFLE} | \
./roundrobin ./pixelngrams 2 | \
time ../../vowpalwabbit/vw --oaa 10 -f mnist11png.model \
-b 20 --adaptive --invariant \
--nn 2 --inpass --holdout_off \
-l 0.02 --passes 15 -k --compressed --cache_file mnist11png.cache && \
rm -f mnist11png.cache