Skip to content

Commit

Permalink
Add integration test suite using MNIST dataset
Browse files Browse the repository at this point in the history
This simple test suite performs multi-class logistic regression on the
MNIST dataset using the D MXNet wrapper library.  It does not provide
comprehensive coverage (and is not intended to), but should provide a
basic sanity check of the library's behaviour.

A build dependency on `download-mnist` is included to ensure the dataset
will be available before the test suite is run.  An extra Travis install
stage has been added to ensure that CI will download the data in advance
of invoking `make`, meaning that download failure will count as an error
rather than a build failure.  Travis cache settings have also been added
to prevent the data needing to be downloaded again and again with every
individual build.  Since `beaver` automatically ensures that `$HOME` is
shared between the host system and the docker container, we do not need
to add any custom setup to provide Travis' caching service with access
to the data download directory.

`LDFLAGS` have been extended for the `test-mxnet.stamp` target so as to
include libraries required by the `ocean` functionality the test suite
depends on.  The docker build script has been updated to install these
dependencies.
  • Loading branch information
joseph-wakeling-sociomantic committed Aug 4, 2017
1 parent 9ec520e commit eae9e3f
Show file tree
Hide file tree
Showing 5 changed files with 706 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ sudo: required
services:
- docker

cache:
directories:
- $HOME/.cache/mnist/

# Disable automatic submodule fetching to prevent
# it from being done recursively
git:
Expand All @@ -26,6 +30,8 @@ env:
- DC=dmd-transitional DIST=xenial F=production
- DC=dmd-transitional DIST=xenial F=devel

install: beaver install
install:
- beaver install
- beaver run script/download-mnist

script: beaver run ci/run.sh
4 changes: 4 additions & 0 deletions Build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ endif
.PHONY: download-mnist
download-mnist: $C/script/download-mnist
$(call exec,sh $(if $V,,-x) $^,$(MNIST_DATA_DIR),$^)

$O/test-mxnet.stamp: override LDFLAGS += -lz
$O/test-mxnet.stamp: override ITFLAGS += $(MNIST_DATA_DIR)
$O/test-mxnet.stamp: download-mnist
3 changes: 2 additions & 1 deletion docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ apt-get update

# Install dmxnet dependencies
apt-get install -y \
libmxnet
libmxnet \
zlib1g-dev
Loading

0 comments on commit eae9e3f

Please sign in to comment.