Skip to content

Commit

Permalink
Fix download (#398)
Browse files Browse the repository at this point in the history
* Add download.bat

* Fix path to download files
  • Loading branch information
mattn committed Apr 23, 2020
1 parent bc51c8e commit 5fb5944
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.bat text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.svg text
*.svg text
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ _testmain.go
cudamodules.go

# vendor
/vendor
/vendor

# Example files
examples/convnet/tmp.dot
examples/iris/cmd/theta.bin
examples/iris/theta.bin
examples/testdata
15 changes: 15 additions & 0 deletions examples/mnist/download.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off

setlocal
set PWD=%~dp0
mkdir ..\testdata\mnist 2>NUL
cd /D..\testdat\mnista

curl -O http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz

gzip -f -d t*-ubyte.gz

cd /D %PWD%
7 changes: 5 additions & 2 deletions examples/mnist/download.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/bash

DST=${1:-$GOPATH/src/gorgonia.org/gorgonia/examples/testdata}
set -e

DST=$(cd $(dirname $0)/../testdata/mnist; pwd)
mkdir -p $DST 2> /dev/null
cd "$DST"

curl -O http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
curl -O http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz

gunzip t*-ubyte.gz
gzip -f -d t*-ubyte.gz

0 comments on commit 5fb5944

Please sign in to comment.