This is an automated email from the ASF dual-hosted git repository.

cmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 449e17d   #13385 [Clojure] - Turn examples into integration tests 
(#13554)
449e17d is described below

commit 449e17dbf2ec671037d4b127a28897b157f80bf3
Author: Nicolas Modrzyk <[email protected]>
AuthorDate: Wed Dec 12 07:17:37 2018 +0900

     #13385 [Clojure] - Turn examples into integration tests (#13554)
---
 .../src/cnn_text_classification/classifier.clj     |  14 +-
 .../cnn_text_classification/classifier_test.clj    |  44 ++++
 contrib/clojure-package/examples/gan/project.clj   |   3 +-
 .../examples/gan/src/gan/gan_mnist.clj             |   6 +-
 .../clojure-package/examples/gan/src/gan/viz.clj   |   4 +-
 .../gan/{project.clj => test/gan/gan_test.clj}     |  15 +-
 .../src/imclassification/train_mnist.clj           |  20 +-
 .../test/imclassification/train_mnist_test.clj}    |  29 ++-
 .../imclassification/test/test-symbol.json.ref     | 105 ++++++++
 .../project.clj => module/test/mnist_mlp_test.clj} |  19 +-
 .../test/multi_label_test.clj}                     |  16 +-
 .../neural-style/src/neural_style/core.clj         |  22 +-
 .../neural-style/test/neural_style/vgg_19_test.clj |  53 ++++
 .../examples/profiler/src/profiler/core.clj        |   6 +-
 .../project.clj => profiler/test/core_test.clj}    |  21 +-
 .../profiler/test/profile-matmul-20iter.json.ref   | 271 +++++++++++++++++++++
 .../examples/rnn/src/rnn/test_char_rnn.clj         |   4 +
 .../examples/rnn/src/rnn/train_char_rnn.clj        |   4 +
 .../project.clj => rnn/test/rnn/core_test.clj}     |  16 +-
 .../clojure-package/examples/tutorial/.gitignore   |   1 +
 .../clojure-package/examples/tutorial/project.clj  |   2 +
 .../examples/tutorial/src/tutorial/module.clj      |  35 ++-
 .../examples/tutorial/src/tutorial/ndarray.clj     |   8 +-
 .../examples/tutorial/src/tutorial/symbol.clj      |  10 +-
 .../test/tutorial/core_test.clj}                   |  17 +-
 .../test/visualization/core_test.clj}              |  18 +-
 contrib/clojure-package/integration-tests.sh       |  28 +++
 .../nightly/apache_rat_license_check/rat-excludes  |   4 +-
 28 files changed, 705 insertions(+), 90 deletions(-)

diff --git 
a/contrib/clojure-package/examples/cnn-text-classification/src/cnn_text_classification/classifier.clj
 
b/contrib/clojure-package/examples/cnn-text-classification/src/cnn_text_classification/classifier.clj
index 29ff36f..94fd4f5 100644
--- 
a/contrib/clojure-package/examples/cnn-text-classification/src/cnn_text_classification/classifier.clj
+++ 
b/contrib/clojure-package/examples/cnn-text-classification/src/cnn_text_classification/classifier.clj
@@ -16,7 +16,9 @@
 ;;
 
 (ns cnn-text-classification.classifier
-  (:require [cnn-text-classification.data-helper :as data-helper]
+  (:require [clojure.java.io :as io]
+            [clojure.java.shell :refer [sh]]
+            [cnn-text-classification.data-helper :as data-helper]
             [org.apache.clojure-mxnet.eval-metric :as eval-metric]
             [org.apache.clojure-mxnet.io :as mx-io]
             [org.apache.clojure-mxnet.module :as m]
@@ -26,12 +28,18 @@
             [org.apache.clojure-mxnet.context :as context])
   (:gen-class))
 
+(def data-dir "data/")
 (def mr-dataset-path "data/mr-data") ;; the MR polarity dataset path
 (def glove-file-path "data/glove/glove.6B.50d.txt")
 (def num-filter 100)
 (def num-label 2)
 (def dropout 0.5)
 
+
+
+(when-not (.exists (io/file (str data-dir)))
+  (do (println "Retrieving data for cnn text classification...") (sh 
"./get_data.sh")))
+
 (defn shuffle-data [test-num {:keys [data label sentence-count sentence-size 
embedding-size]}]
   (println "Shuffling the data and splitting into training and test sets")
   (println {:sentence-count sentence-count
@@ -103,10 +111,10 @@
   ;;; omit max-examples if you want to run all the examples in the movie 
review dataset
     ;; to limit mem consumption set to something like 1000 and adjust test 
size to 100
     (println "Running with context devices of" devs)
-    (train-convnet {:devs [(context/cpu)] :embedding-size 50 :batch-size 10 
:test-size 100 :num-epoch 10 :max-examples 1000})
+    (train-convnet {:devs devs :embedding-size 50 :batch-size 10 :test-size 
100 :num-epoch 10 :max-examples 1000})
     ;; runs all the examples
     #_(train-convnet {:embedding-size 50 :batch-size 100 :test-size 1000 
:num-epoch 10})))
 
 (comment
-  (train-convnet {:devs [(context/cpu)] :embedding-size 50 :batch-size 10 
:test-size 100 :num-epoch 10 :max-examples 1000}))
+  (train-convnet {:devs devs :embedding-size 50 :batch-size 10 :test-size 100 
:num-epoch 10 :max-examples 1000}))
 
diff --git 
a/contrib/clojure-package/examples/cnn-text-classification/test/cnn_text_classification/classifier_test.clj
 
b/contrib/clojure-package/examples/cnn-text-classification/test/cnn_text_classification/classifier_test.clj
new file mode 100644
index 0000000..918a46f
--- /dev/null
+++ 
b/contrib/clojure-package/examples/cnn-text-classification/test/cnn_text_classification/classifier_test.clj
@@ -0,0 +1,44 @@
+;;
+;; Licensed to the Apache Software Foundation (ASF) under one or more
+;; contributor license agreements.  See the NOTICE file distributed with
+;; this work for additional information regarding copyright ownership.
+;; The ASF licenses this file to You under the Apache License, Version 2.0
+;; (the "License"); you may not use this file except in compliance with
+;; the License.  You may obtain a copy of the License at
+;;
+;;    http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+;;
+
+(ns cnn-text-classification.classifier-test
+       (:require 
+               [clojure.test :refer :all]
+               [org.apache.clojure-mxnet.module :as module]
+               [org.apache.clojure-mxnet.ndarray :as ndarray]
+               [org.apache.clojure-mxnet.util :as util]
+               [org.apache.clojure-mxnet.context :as context]
+               [cnn-text-classification.classifier :as classifier]))
+
+;
+; The one and unique classifier test
+;
+(deftest classifier-test
+       (let [train
+    (classifier/train-convnet 
+       {:devs [(context/default-context)]
+         :embedding-size 50 
+         :batch-size 10 
+         :test-size 100 
+         :num-epoch 1 
+         :max-examples 1000})]
+    (is (= ["data"] (util/scala-vector->vec (module/data-names train))))
+    (is (= 20 (count (ndarray/->vec (-> train module/outputs first first)))))))
+    ;(prn (util/scala-vector->vec (data-shapes train)))        
+    ;(prn (util/scala-vector->vec (label-shapes train)))
+    ;(prn (output-names train))
+    ;(prn (output-shapes train))
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/gan/project.clj
index b8f6903..a326f7a 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/gan/project.clj
@@ -20,5 +20,6 @@
   :plugins [[lein-cljfmt "0.5.7"]]
   :dependencies [[org.clojure/clojure "1.9.0"]
                  [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
+                 [org.openpnp/opencv "3.4.2-1"]
+                 ]
   :main gan.gan-mnist)
diff --git a/contrib/clojure-package/examples/gan/src/gan/gan_mnist.clj 
b/contrib/clojure-package/examples/gan/src/gan/gan_mnist.clj
index e2e3364..944791b 100644
--- a/contrib/clojure-package/examples/gan/src/gan/gan_mnist.clj
+++ b/contrib/clojure-package/examples/gan/src/gan/gan_mnist.clj
@@ -157,7 +157,9 @@
 
       (save-img-diff i n calc-diff))))
 
-(defn train [devs]
+(defn train 
+  ([devs] (train devs num-epoch))
+  ([devs num-epoch]
   (let [mod-d  (-> (m/module (discriminator) {:contexts devs :data-names 
["data"] :label-names ["label"]})
                    (m/bind {:data-shapes (mx-io/provide-data-desc mnist-iter)
                             :label-shapes (mx-io/provide-label-desc mnist-iter)
@@ -203,7 +205,7 @@
                                   (save-img-gout i n (ndarray/copy (ffirst 
out-g)))
                                   (save-img-data i n batch)
                                   (calc-diff i n (ffirst diff-d)))
-                                (inc n)))))))
+                                (inc n))))))))
 
 (defn -main [& args]
   (let [[dev dev-num] args
diff --git a/contrib/clojure-package/examples/gan/src/gan/viz.clj 
b/contrib/clojure-package/examples/gan/src/gan/viz.clj
index 8b57b94..67f7880 100644
--- a/contrib/clojure-package/examples/gan/src/gan/viz.clj
+++ b/contrib/clojure-package/examples/gan/src/gan/viz.clj
@@ -22,7 +22,7 @@
   (:import (nu.pattern OpenCV)
            (org.opencv.core Core CvType Mat Size)
            (org.opencv.imgproc Imgproc)
-           (org.opencv.highgui Highgui)))
+           (org.opencv.imgcodecs Imgcodecs)))
 
 ;;; Viz stuff
 (OpenCV/loadShared)
@@ -83,5 +83,5 @@
         _ (Core/vconcat (java.util.ArrayList. line-mats) result)]
     (do
       (Imgproc/resize result resized-img (new Size (* (.width result) 1.5) (* 
(.height result) 1.5)))
-      (Highgui/imwrite (str output-path title ".jpg") resized-img)
+      (Imgcodecs/imwrite (str output-path title ".jpg") resized-img)
       (Thread/sleep 1000))))
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/gan/test/gan/gan_test.clj
similarity index 72%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/gan/test/gan/gan_test.clj
index b8f6903..71b9126 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/gan/test/gan/gan_test.clj
@@ -15,10 +15,11 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns gan.gan_test
+ (:require 
+       [gan.gan-mnist :refer :all]
+       [org.apache.clojure-mxnet.context :as context]
+       [clojure.test :refer :all]))
+
+(deftest check-pdf 
+       (train [(context/cpu)] 1))
\ No newline at end of file
diff --git 
a/contrib/clojure-package/examples/imclassification/src/imclassification/train_mnist.clj
 
b/contrib/clojure-package/examples/imclassification/src/imclassification/train_mnist.clj
index a43dc3b..e61e9eb 100644
--- 
a/contrib/clojure-package/examples/imclassification/src/imclassification/train_mnist.clj
+++ 
b/contrib/clojure-package/examples/imclassification/src/imclassification/train_mnist.clj
@@ -32,7 +32,7 @@
 (def batch-size 10) ;; the batch size
 (def optimizer (optimizer/sgd {:learning-rate 0.01 :momentum 0.0}))
 (def eval-metric (eval-metric/accuracy))
-(def num-epoch 5) ;; the number of training epochs
+(def num-epoch 1) ;; the number of training epochs
 (def kvstore "local") ;; the kvstore type
 ;;; Note to run distributed you might need to complile the engine with an 
option set
 (def role "worker") ;; scheduler/server/worker
@@ -82,7 +82,9 @@
     (sym/fully-connected "fc3" {:data data :num-hidden 10})
     (sym/softmax-output "softmax" {:data data})))
 
-(defn start [devs]
+(defn start 
+  ([devs] (start devs num-epoch))
+  ([devs _num-epoch]
   (when scheduler-host
     (println "Initing PS enviornments with " envs)
     (kvstore-server/init envs))
@@ -94,14 +96,18 @@
     (do
       (println "Starting Training of MNIST ....")
       (println "Running with context devices of" devs)
-      (let [mod (m/module (get-symbol) {:contexts devs})]
-        (m/fit mod {:train-data train-data
+      (let [_mod (m/module (get-symbol) {:contexts devs})]
+        (m/fit _mod {:train-data train-data
                     :eval-data test-data
-                    :num-epoch num-epoch
+                    :num-epoch _num-epoch
                     :fit-params (m/fit-params {:kvstore kvstore
                                                :optimizer optimizer
-                                               :eval-metric eval-metric})}))
-      (println "Finish fit"))))
+                                               :eval-metric eval-metric})})
+        (println "Finish fit")
+        _mod
+        )
+      
+      ))))
 
 (defn -main [& args]
   (let [[dev dev-num] args
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/imclassification/test/imclassification/train_mnist_test.clj
similarity index 55%
copy from contrib/clojure-package/examples/gan/project.clj
copy to 
contrib/clojure-package/examples/imclassification/test/imclassification/train_mnist_test.clj
index b8f6903..2ebefc2 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ 
b/contrib/clojure-package/examples/imclassification/test/imclassification/train_mnist_test.clj
@@ -15,10 +15,25 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns imclassification.train-mnist-test
+       (:require 
+               [clojure.test :refer :all]
+               [clojure.java.io :as io]
+               [clojure.string :as s]
+               [org.apache.clojure-mxnet.context :as context]
+               [org.apache.clojure-mxnet.module :as module]
+               [imclassification.train-mnist :as mnist]))
+
+(defn- file-to-filtered-seq [file]
+       (->>
+               file 
+               (io/file)
+               (io/reader)
+               (line-seq)
+               (filter  #(not (s/includes? % "mxnet_version")))))
+
+(deftest mnist-two-epochs-test
+       (module/save-checkpoint (mnist/start [(context/cpu)] 2) {:prefix 
"target/test" :epoch 2})
+       (is (= 
+               (file-to-filtered-seq "test/test-symbol.json.ref") 
+               (file-to-filtered-seq "target/test-symbol.json"))))
\ No newline at end of file
diff --git 
a/contrib/clojure-package/examples/imclassification/test/test-symbol.json.ref 
b/contrib/clojure-package/examples/imclassification/test/test-symbol.json.ref
new file mode 100644
index 0000000..ba1d2fa
--- /dev/null
+++ 
b/contrib/clojure-package/examples/imclassification/test/test-symbol.json.ref
@@ -0,0 +1,105 @@
+{
+  "nodes": [
+    {
+      "op": "null", 
+      "name": "data", 
+      "inputs": []
+    }, 
+    {
+      "op": "null", 
+      "name": "fc1_weight", 
+      "attrs": {"num_hidden": "128"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "null", 
+      "name": "fc1_bias", 
+      "attrs": {"num_hidden": "128"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "FullyConnected", 
+      "name": "fc1", 
+      "attrs": {"num_hidden": "128"}, 
+      "inputs": [[0, 0, 0], [1, 0, 0], [2, 0, 0]]
+    }, 
+    {
+      "op": "Activation", 
+      "name": "relu1", 
+      "attrs": {"act_type": "relu"}, 
+      "inputs": [[3, 0, 0]]
+    }, 
+    {
+      "op": "null", 
+      "name": "fc2_weight", 
+      "attrs": {"num_hidden": "64"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "null", 
+      "name": "fc2_bias", 
+      "attrs": {"num_hidden": "64"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "FullyConnected", 
+      "name": "fc2", 
+      "attrs": {"num_hidden": "64"}, 
+      "inputs": [[4, 0, 0], [5, 0, 0], [6, 0, 0]]
+    }, 
+    {
+      "op": "Activation", 
+      "name": "relu2", 
+      "attrs": {"act_type": "relu"}, 
+      "inputs": [[7, 0, 0]]
+    }, 
+    {
+      "op": "null", 
+      "name": "fc3_weight", 
+      "attrs": {"num_hidden": "10"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "null", 
+      "name": "fc3_bias", 
+      "attrs": {"num_hidden": "10"}, 
+      "inputs": []
+    }, 
+    {
+      "op": "FullyConnected", 
+      "name": "fc3", 
+      "attrs": {"num_hidden": "10"}, 
+      "inputs": [[8, 0, 0], [9, 0, 0], [10, 0, 0]]
+    }, 
+    {
+      "op": "null", 
+      "name": "softmax_label", 
+      "inputs": []
+    }, 
+    {
+      "op": "SoftmaxOutput", 
+      "name": "softmax", 
+      "inputs": [[11, 0, 0], [12, 0, 0]]
+    }
+  ], 
+  "arg_nodes": [0, 1, 2, 5, 6, 9, 10, 12], 
+  "node_row_ptr": [
+    0, 
+    1, 
+    2, 
+    3, 
+    4, 
+    5, 
+    6, 
+    7, 
+    8, 
+    9, 
+    10, 
+    11, 
+    12, 
+    13, 
+    14
+  ], 
+  "heads": [[13, 0, 0]], 
+  "attrs": {"mxnet_version": ["int", 10400]}
+}
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/module/test/mnist_mlp_test.clj
similarity index 64%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/module/test/mnist_mlp_test.clj
index b8f6903..5fbcdd3 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/module/test/mnist_mlp_test.clj
@@ -14,11 +14,16 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
+(ns mnist-mlp-test
+       (:require 
+               [mnist-mlp :refer :all]
+               [org.apache.clojure-mxnet.context :as context]
+               [clojure.test :refer :all]))
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(deftest run-those-tests
+       (let [devs [(context/cpu)]]
+         (run-intermediate-level-api :devs devs)
+         (run-intermediate-level-api :devs devs :load-model-epoch (dec 
num-epoch))
+         (run-high-level-api devs)
+         (run-prediction-iterator-api devs)
+         (run-predication-and-calc-accuracy-manually devs)))
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/multi-label/test/multi_label_test.clj
similarity index 72%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/multi-label/test/multi_label_test.clj
index b8f6903..446a846 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/multi-label/test/multi_label_test.clj
@@ -15,10 +15,12 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns multi_label_test
+ (:require 
+       [multi-label.core :as label]
+       [clojure.java.io :as io]
+       [org.apache.clojure-mxnet.context :as context]
+       [clojure.test :refer :all]))
+
+(deftest run-multi-label
+       (label/train [(context/cpu)]))
\ No newline at end of file
diff --git 
a/contrib/clojure-package/examples/neural-style/src/neural_style/core.clj 
b/contrib/clojure-package/examples/neural-style/src/neural_style/core.clj
index fcf402f..ac1f537 100644
--- a/contrib/clojure-package/examples/neural-style/src/neural_style/core.clj
+++ b/contrib/clojure-package/examples/neural-style/src/neural_style/core.clj
@@ -24,6 +24,8 @@
             [org.apache.clojure-mxnet.random :as random]
             [org.apache.clojure-mxnet.shape :as mx-shape]
             [org.apache.clojure-mxnet.symbol :as sym]
+            [clojure.java.io :as io]
+            [clojure.java.shell :refer [sh]]
             [mikera.image.core :as img]
             [mikera.image.filters :as img-filter]
             [think.image.pixel :as pixel]
@@ -31,6 +33,9 @@
   (:gen-class));; An Implementation of the paper A Neural Algorithm of 
Artistic Style
  ;;by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge
 
+(when-not (.exists (io/file "input"))
+  (do (println "Retrieving data...") (sh "./download.sh")))
+
 (def content-image "input/IMG_4343.jpg")
 (def style-image "input/starry_night.jpg")
 (def model-path "model/vgg19.params")
@@ -39,7 +44,7 @@
 (def content-weight 5) ;; the weight for the content image
 (def blur-radius 1) ;; the blur filter radius
 (def output-dir "output")
-(def lr 10) ;; the learning rate
+(def lr 10.0) ;; the learning rate
 (def tv-weight 0.01) ;; the magnitude on the tv loss
 (def num-epochs 1000)
 (def num-channels 3)
@@ -157,9 +162,10 @@
           out (ndarray/* out tv-weight)]
       (sym/bind out ctx {"img" img "kernel" kernel}))))
 
-(defn train [devs]
-
-  (let [dev (first devs)
+(defn train 
+  ([devs] (train devs 20)) 
+  ([devs n-epochs]
+    (let [dev (first devs)
         content-np (preprocess-content-image content-image max-long-edge)
         content-np-shape (mx-shape/->vec (ndarray/shape content-np))
         style-np (preprocess-style-image style-image content-np-shape)
@@ -212,7 +218,7 @@
         tv-grad-executor (get-tv-grad-executor img dev tv-weight)
         eps 0.0
         e 0]
-    (doseq [i (range 20)]
+    (doseq [i (range n-epochs)]
       (ndarray/set (:data model-executor) img)
       (-> (:executor model-executor)
           (executor/forward)
@@ -237,8 +243,10 @@
         (println "Epoch " i  "relative change " eps)
         (when (zero? (mod i 2))
           (save-image (ndarray/copy img) (str output-dir "/out_" i ".png") 
blur-radius true)))
-
-      (ndarray/set old-img img))))
+      (ndarray/set old-img img))
+    ; (save-image (ndarray/copy img) (str output-dir "/final.png") 0 false)
+    ; (postprocess-image img)
+    )))
 
 (defn -main [& args]
   ;;; Note this only works on cpu right now
diff --git 
a/contrib/clojure-package/examples/neural-style/test/neural_style/vgg_19_test.clj
 
b/contrib/clojure-package/examples/neural-style/test/neural_style/vgg_19_test.clj
new file mode 100644
index 0000000..a7c9786
--- /dev/null
+++ 
b/contrib/clojure-package/examples/neural-style/test/neural_style/vgg_19_test.clj
@@ -0,0 +1,53 @@
+;;
+;; Licensed to the Apache Software Foundation (ASF) under one or more
+;; contributor license agreements.  See the NOTICE file distributed with
+;; this work for additional information regarding copyright ownership.
+;; The ASF licenses this file to You under the Apache License, Version 2.0
+;; (the "License"); you may not use this file except in compliance with
+;; the License.  You may obtain a copy of the License at
+;;
+;;    http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+;;
+
+(ns neural-style.vgg-19-test
+       (:require 
+               [clojure.test :refer :all]
+               [mikera.image.core :as img]
+               [clojure.java.io :as io]
+               [org.apache.clojure-mxnet.ndarray :as ndarray]
+               [org.apache.clojure-mxnet.context :as context]
+               [neural-style.core :as neural]))
+
+(defn pic-to-ndarray-vec[path]
+       (-> path 
+               img/load-image 
+               neural/image->ndarray
+               ndarray/->vec))
+
+(defn last-modified-check[x]
+       (let [t (- (System/currentTimeMillis) (.lastModified x)) ]
+       (if (> 10000 t) ; 10 seconds 
+               x
+               (throw (Exception. (str "Generated File Too Old: (" t " ms) [" 
x "]"))))))
+
+(defn latest-pic-to-ndarray-vec[folder]
+        (->> folder 
+               io/as-file
+               (.listFiles)
+               (sort-by #(.lastModified %))
+               last
+               (last-modified-check)
+               (.getPath)
+               pic-to-ndarray-vec))
+
+(deftest vgg-19-test
+       (neural/train [(context/cpu)] 3)
+    (is (not (nil? (latest-pic-to-ndarray-vec "output")))))
+; generated file different depending on the platform :/ 
+; (pic-to-ndarray-vec "test/ref_out_2.png"))))
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/profiler/src/profiler/core.clj 
b/contrib/clojure-package/examples/profiler/src/profiler/core.clj
index e366c57..67ba0fe 100644
--- a/contrib/clojure-package/examples/profiler/src/profiler/core.clj
+++ b/contrib/clojure-package/examples/profiler/src/profiler/core.clj
@@ -27,9 +27,9 @@
 (def profiler-mode "symbolic") ;; can be symbolic, imperative, api, mem
 (def output-path ".") ;; the profile file output directory
 (def profiler-name "profile-matmul-20iter.json")
-(def iter-num 100)
-(def begin-profiling-iter 50)
-(def end-profiling-iter 70)
+(def iter-num 5)
+(def begin-profiling-iter 0)
+(def end-profiling-iter 1)
 (def gpu? false)
 
 (defn run []
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/profiler/test/core_test.clj
similarity index 66%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/profiler/test/core_test.clj
index b8f6903..1173f07 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/profiler/test/core_test.clj
@@ -15,10 +15,17 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns core_test
+ (:require 
+       [profiler.core :as profiler]
+       [clojure.java.io :as io]
+       [clojure.test :refer :all]))
+
+(defn count-lines[file]
+       (count (line-seq (io/reader (io/as-file file)))))
+
+(deftest run-profiler
+       (profiler/run)
+       (let [new-file (clojure.java.io/as-file profiler/profiler-name)]
+               (is (.exists new-file))
+               (is (> 10000 (- (System/currentTimeMillis) (.lastModified 
new-file))))))
\ No newline at end of file
diff --git 
a/contrib/clojure-package/examples/profiler/test/profile-matmul-20iter.json.ref 
b/contrib/clojure-package/examples/profiler/test/profile-matmul-20iter.json.ref
new file mode 100644
index 0000000..d6baa42
--- /dev/null
+++ 
b/contrib/clojure-package/examples/profiler/test/profile-matmul-20iter.json.ref
@@ -0,0 +1,271 @@
+{
+    "traceEvents": [
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu/0"
+            },
+            "pid": 0,
+            "name": "process_name"
+        },
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu/1"
+            },
+            "pid": 1,
+            "name": "process_name"
+        },
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu/2"
+            },
+            "pid": 2,
+            "name": "process_name"
+        },
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu/3"
+            },
+            "pid": 3,
+            "name": "process_name"
+        },
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu pinned/"
+            },
+            "pid": 4,
+            "name": "process_name"
+        },
+        {
+            "ph": "M",
+            "args": {
+                "name": "cpu shared/"
+            },
+            "pid": 5,
+            "name": "process_name"
+        },        {
+            "ph": "M",
+            "args": {
+                "name": "MXNET_C_API"
+            },
+            "pid": 13841910479334118176,
+            "name": "process_name"
+        },
+
+    {
+        "name": "MXNet C API Calls",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51195258331,
+        "args": { "MXNet C API Calls": 1 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "MXNet C API Concurrency",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51195258338,
+        "args": { "MXNet C API Concurrency": 1 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "MXExecutorForward",
+        "cat": "MXNET_C_API",
+        "ph": "b",
+        "ts": 51195258348,
+        "id": 6902988396839073221,
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "MXExecutorForward",
+        "cat": "MXNET_C_API",
+        "ph": "e",
+        "ts": 51195258357,
+        "id": 6902988396839073221,
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "MXNet C API Concurrency",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51195258358,
+        "args": { "MXNet C API Concurrency": 0 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,        {
+            "ph": "M",
+            "args": {
+                "name": "Device Storage"
+            },
+            "pid": 13545698322897290393,
+            "name": "process_name"
+        },
+
+    {
+        "name": "Memory: cpu/0",
+        "cat": "Device Storage",
+        "ph": "C",
+        "ts": 51195543378,
+        "args": { "Memory: cpu/0": 8 },
+        "pid": 13545698322897290393,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "MXNet C API Calls",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51195258559,
+        "args": { "MXNet C API Calls": 2 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "Memory: cpu/0",
+        "cat": "Device Storage",
+        "ph": "C",
+        "ts": 51195857697,
+        "args": { "Memory: cpu/0": 67108872 },
+        "pid": 13545698322897290393,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "MXNet C API Concurrency",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51195258560,
+        "args": { "MXNet C API Concurrency": 1 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+
+    {
+        "name": "[dot]",
+        "cat": "operator",
+        "ph": "B",
+        "ts": 51195857671,
+        "pid": 0,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "[dot]",
+        "cat": "operator",
+        "ph": "E",
+        "ts": 51196931353,
+        "pid": 0,
+        "tid": 5603937861270119161
+    }
+,
+
+    {
+        "name": "WaitForVar",
+        "cat": "operator",
+        "ph": "B",
+        "ts": 51196931369,
+        "pid": 0,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "WaitForVar",
+        "cat": "operator",
+        "ph": "E",
+        "ts": 51196931376,
+        "pid": 0,
+        "tid": 5603937861270119161
+    }
+,        {
+            "ph": "M",
+            "args": {
+                "name": "operator"
+            },
+            "pid": 10847949044720084585,
+            "name": "process_name"
+        },
+
+    {
+        "name": "[dot]",
+        "cat": "operator",
+        "ph": "b",
+        "ts": 51195857671,
+        "id": 5603937861270119161,
+        "pid": 10847949044720084585,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "[dot]",
+        "cat": "operator",
+        "ph": "e",
+        "ts": 51196931350,
+        "id": 5603937861270119161,
+        "pid": 10847949044720084585,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "MXNDArrayWaitToRead",
+        "cat": "MXNET_C_API",
+        "ph": "b",
+        "ts": 51195258561,
+        "id": 6902988396839073221,
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "MXNDArrayWaitToRead",
+        "cat": "MXNET_C_API",
+        "ph": "e",
+        "ts": 51196931386,
+        "id": 6902988396839073221,
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
+,
+    {
+        "name": "WaitForVar",
+        "cat": "operator",
+        "ph": "b",
+        "ts": 51196931369,
+        "id": 5603937861270119161,
+        "pid": 10847949044720084585,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "WaitForVar",
+        "cat": "operator",
+        "ph": "e",
+        "ts": 51196931376,
+        "id": 5603937861270119161,
+        "pid": 10847949044720084585,
+        "tid": 5603937861270119161
+    }
+,
+    {
+        "name": "MXNet C API Concurrency",
+        "cat": "MXNET_C_API",
+        "ph": "C",
+        "ts": 51196931391,
+        "args": { "MXNet C API Concurrency": 0 },
+        "pid": 13841910479334118176,
+        "tid": 6902988396839073221
+    }
diff --git a/contrib/clojure-package/examples/rnn/src/rnn/test_char_rnn.clj 
b/contrib/clojure-package/examples/rnn/src/rnn/test_char_rnn.clj
index d03b1a6..22a2982 100644
--- a/contrib/clojure-package/examples/rnn/src/rnn/test_char_rnn.clj
+++ b/contrib/clojure-package/examples/rnn/src/rnn/test_char_rnn.clj
@@ -17,6 +17,7 @@
 
 (ns rnn.test-char-rnn
   (:require [clojure.string :as string]
+            [clojure.java.shell :refer [sh]]
             [rnn.util :as util]
             [rnn.lstm :as lstm]
             [org.apache.clojure-mxnet.context :as context]
@@ -24,6 +25,9 @@
             [org.apache.clojure-mxnet.module :as m]
             [org.apache.clojure-mxnet.ndarray :as ndarray]))
 
+(when-not (.exists (clojure.java.io/file "data"))
+  (do (println "Retrieving data...") (sh "./get_data.sh")))
+
 (def data-path "data/obama.txt")
 (def model-prefix)
 (def start-sentence "The joke ")
diff --git a/contrib/clojure-package/examples/rnn/src/rnn/train_char_rnn.clj 
b/contrib/clojure-package/examples/rnn/src/rnn/train_char_rnn.clj
index 150cd94..41a764f 100644
--- a/contrib/clojure-package/examples/rnn/src/rnn/train_char_rnn.clj
+++ b/contrib/clojure-package/examples/rnn/src/rnn/train_char_rnn.clj
@@ -17,6 +17,7 @@
 
 (ns rnn.train-char-rnn
   (:require  [clojure.string :as string]
+             [clojure.java.shell :refer [sh]]
              [rnn.util :as util]
              [rnn.lstm :as lstm]
              [rnn.test-char-rnn :as test-rnn]
@@ -34,6 +35,9 @@
 
 
;;https://github.com/apache/incubator-mxnet/blob/master/example/rnn/old/char-rnn.ipynb
 
+(when-not (.exists (clojure.java.io/file "data"))
+  (do (println "Retrieving data...") (sh "./get_data.sh")))
+
 ;; batch size for training
 (def batch-size 32)
 ;; we can support various length input
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/rnn/test/rnn/core_test.clj
similarity index 67%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/rnn/test/rnn/core_test.clj
index b8f6903..b198577 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/rnn/test/rnn/core_test.clj
@@ -15,10 +15,12 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns rnn.core_test
+ (:require 
+       [rnn.test-char-rnn :as rnn]
+       [clojure.test :refer :all]))
+
+(deftest check-trained-network
+       (is (= 
+               "The joke that we can start by the challenges of the American 
people. The American people have been talking about how to compete with the 
streets of San Antonio who the courage to come together as one "
+        (rnn/rnn-test "data/obama" 75 200 false))))
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/tutorial/.gitignore 
b/contrib/clojure-package/examples/tutorial/.gitignore
index c53038e..338927e 100644
--- a/contrib/clojure-package/examples/tutorial/.gitignore
+++ b/contrib/clojure-package/examples/tutorial/.gitignore
@@ -9,3 +9,4 @@ pom.xml.asc
 /.nrepl-port
 .hgignore
 .hg/
+filename
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/tutorial/project.clj 
b/contrib/clojure-package/examples/tutorial/project.clj
index 8a78ec6..58a10f0 100644
--- a/contrib/clojure-package/examples/tutorial/project.clj
+++ b/contrib/clojure-package/examples/tutorial/project.clj
@@ -19,6 +19,8 @@
   :description "MXNET tutorials"
   :plugins [[lein-cljfmt "0.5.7"]]
   :dependencies [[org.clojure/clojure "1.9.0"]
+                                
[org.apache.mxnet.contrib.clojure/clojure-mxnet "1.5.0-SNAPSHOT"]
+
                  ;; Uncomment the one appropriate for your machine & 
configuration:
                  #_[org.apache.mxnet.contrib.clojure/clojure-mxnet-linux-cpu 
"1.4.0"]
                  #_[org.apache.mxnet.contrib.clojure/clojure-mxnet-linux-gpu 
"1.4.0"]
diff --git a/contrib/clojure-package/examples/tutorial/src/tutorial/module.clj 
b/contrib/clojure-package/examples/tutorial/src/tutorial/module.clj
index 4ca50ff..e194981 100644
--- a/contrib/clojure-package/examples/tutorial/src/tutorial/module.clj
+++ b/contrib/clojure-package/examples/tutorial/src/tutorial/module.clj
@@ -184,7 +184,7 @@
                                      ]))
     (m/save-checkpoint mod {:prefix save-prefix
                             :epoch epoch-num
-                            :save-opt-states true})))
+                            :save-opt-states true}))) 
 
 ;; INFO  org.apache.mxnet.module.Module: Saved checkpoint to 
my-model-0000.params
 ;; INFO  org.apache.mxnet.module.Module: Saved optimizer state to 
my-model-0000.states
@@ -247,7 +247,40 @@ new-mod ;=> #object[org.apache.mxnet.module.Module 
0x5304d0f4 "org.apache.mxnet.
 
 ;; Create `fit-params` and then use it to set `begin-epoch` so that
 ;; `fit` knows to resume from a saved epoch.
+
+
+(comment 
+;; FIXME
+; Caused by: java.io.EOFException
+;   at java.io.DataInputStream.readInt(DataInputStream.java:392)
+;   at 
java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:3182)
+;   at java.io.ObjectInputStream.readInt(ObjectInputStream.java:1032)
+;   at 
org.apache.mxnet.Optimizer$$anon$1$$anonfun$deserializeState$1.apply$mcVI$sp(Optimizer.scala:84)
+;   at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
+;   at org.apache.mxnet.Optimizer$$anon$1.deserializeState(Optimizer.scala:83)
+;   at 
org.apache.mxnet.module.Module$$anonfun$loadOptimizerStates$3.apply(Module.scala:594)
+;   at 
org.apache.mxnet.module.Module$$anonfun$loadOptimizerStates$3.apply(Module.scala:589)
+;   at scala.Option.foreach(Option.scala:257)
+;   at org.apache.mxnet.module.Module.loadOptimizerStates(Module.scala:589)
+;   at 
org.apache.mxnet.module.Module$$anonfun$initOptimizer$4.apply(Module.scala:407)
+;   at 
org.apache.mxnet.module.Module$$anonfun$initOptimizer$4.apply(Module.scala:406)
+;   at scala.Option.foreach(Option.scala:257)
+;   at org.apache.mxnet.module.Module.initOptimizer(Module.scala:406)
+;   at org.apache.mxnet.module.BaseModule.fit(BaseModule.scala:407)
+;   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+;   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
+;   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+;   at java.lang.reflect.Method.invoke(Method.java:498)
+;   at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
+;   at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
+;   at org.apache.clojure_mxnet.module$fit.invokeStatic(module.clj:551)
+;   at org.apache.clojure_mxnet.module$fit.invoke(module.clj:538)
+;   at tutorial.module$eval1787.invokeStatic(module.clj:250)
+;   at tutorial.module$eval1787.invoke(module.clj:250)
+
 (m/fit new-mod {:train-data train-data
                 :eval-data test-data
                 :num-epoch 2
                 :fit-params (m/fit-params {:begin-epoch 1})})
+
+)
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/tutorial/src/tutorial/ndarray.clj 
b/contrib/clojure-package/examples/tutorial/src/tutorial/ndarray.clj
index 8e51de2..d18bb53 100644
--- a/contrib/clojure-package/examples/tutorial/src/tutorial/ndarray.clj
+++ b/contrib/clojure-package/examples/tutorial/src/tutorial/ndarray.clj
@@ -91,8 +91,8 @@
 (ndarray/save "filename" {"arr1" arr1 "arr2" arr2})
 ;; (you can also do "s3://path" or "hdfs")
 
-(ndarray/save "/Users/daveliepmann/src/coursework/mxnet-clj-tutorials/abc"
-              {"arr1" arr1 "arr2" arr2})
+;; (ndarray/save "/Users/daveliepmann/src/coursework/mxnet-clj-tutorials/abc"
+;;              {"arr1" arr1 "arr2" arr2})
 
 ;; To load:
 (def from-file (ndarray/load "filename"))
@@ -114,7 +114,9 @@ from-file ;=>{"arr1" #object[org.apache.mxnet.NDArray 
0x6115ba61 "org.apache.mxn
 (def cpu-a (ndarray/zeros [100 200]))
 (ndarray/context cpu-a) ;=> #object[org.apache.mxnet.Context 0x3f376123 
"cpu(0)"]
 
-(def gpu-b (ndarray/zeros [100 200] {:ctx (context/gpu 0)})) ;; to use with gpu
+(comment
+  (def gpu-b (ndarray/zeros [100 200] {:ctx (context/gpu 0)})) ;; to use with 
gpu
+)
 
 ;; Currently, we do not allow operations among arrays from different
 ;; contexts. To manually enable this, use the `copy-to` function to
diff --git a/contrib/clojure-package/examples/tutorial/src/tutorial/symbol.clj 
b/contrib/clojure-package/examples/tutorial/src/tutorial/symbol.clj
index ebf4f7e..e882600 100644
--- a/contrib/clojure-package/examples/tutorial/src/tutorial/symbol.clj
+++ b/contrib/clojure-package/examples/tutorial/src/tutorial/symbol.clj
@@ -125,7 +125,9 @@ net ;=> #object[org.apache.mxnet.Symbol 0x5c78c8c2 
"org.apache.mxnet.Symbol@5c78
     (first)
     (ndarray/->vec));=>  [2.0 2.0 2.0 2.0]
 
-;; We can evaluate the same symbol on GPU with different data.
-;; (To do this you must have the correct native library jar defined as a 
dependency.)
-(def ex (sym/bind c (context/gpu 0) {"a" (ndarray/ones [2 2])
-                                     "b" (ndarray/ones [2 2])}))
+(comment
+  ;; We can evaluate the same symbol on GPU with different data.
+  ;; (To do this you must have the correct native library jar defined as a 
dependency.)
+  (def ex (sym/bind c (context/gpu 0) {"a" (ndarray/ones [2 2])
+                                       "b" (ndarray/ones [2 2])}))
+)
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/tutorial/test/tutorial/core_test.clj
similarity index 72%
copy from contrib/clojure-package/examples/gan/project.clj
copy to contrib/clojure-package/examples/tutorial/test/tutorial/core_test.clj
index b8f6903..0e5169c 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ b/contrib/clojure-package/examples/tutorial/test/tutorial/core_test.clj
@@ -15,10 +15,13 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns tutorial.core_test
+ (:require [clojure.test :refer :all])
+ (:require 
+       [tutorial.introduction]
+       [tutorial.kvstore]
+       [tutorial.module]
+       [tutorial.ndarray]
+       [tutorial.symbol]))
+
+(deftest if-this-goes-here-then-tutorials-have-loaded-properly (is true))
\ No newline at end of file
diff --git a/contrib/clojure-package/examples/gan/project.clj 
b/contrib/clojure-package/examples/visualization/test/visualization/core_test.clj
similarity index 71%
copy from contrib/clojure-package/examples/gan/project.clj
copy to 
contrib/clojure-package/examples/visualization/test/visualization/core_test.clj
index b8f6903..1b10695 100644
--- a/contrib/clojure-package/examples/gan/project.clj
+++ 
b/contrib/clojure-package/examples/visualization/test/visualization/core_test.clj
@@ -15,10 +15,14 @@
 ;; limitations under the License.
 ;;
 
-(defproject gan "0.1.0-SNAPSHOT"
-  :description "GAN MNIST with MXNet"
-  :plugins [[lein-cljfmt "0.5.7"]]
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [org.apache.mxnet.contrib.clojure/clojure-mxnet 
"1.5.0-SNAPSHOT"]
-                 [nu.pattern/opencv "2.4.9-7"]]
-  :main gan.gan-mnist)
+(ns visualization.core_test
+ (:require 
+       [visualization.core :as visualization]
+       [clojure.test :refer :all]))
+
+(deftest check-pdf 
+       (visualization/test-viz)
+       (let [new-pdf (clojure.java.io/as-file "testviz.pdf")]
+               (is (.exists new-pdf))
+               (is (> 10000 (- (System/currentTimeMillis) (.lastModified 
new-pdf))))))
+       
\ No newline at end of file
diff --git a/contrib/clojure-package/integration-tests.sh 
b/contrib/clojure-package/integration-tests.sh
new file mode 100755
index 0000000..3297fdc
--- /dev/null
+++ b/contrib/clojure-package/integration-tests.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -evx
+
+MXNET_HOME=${PWD}
+EXAMPLES_HOME=${MXNET_HOME}/contrib/clojure-package/examples
+#cd ${MXNET_HOME}/contrib/clojure-package
+#lein test
+#lein cloverage --codecov
+for i in `find ${EXAMPLES_HOME} -name test` ; do
+cd ${i} && lein test
+done
diff --git a/tests/nightly/apache_rat_license_check/rat-excludes 
b/tests/nightly/apache_rat_license_check/rat-excludes
index 0d95792..a488eb8 100755
--- a/tests/nightly/apache_rat_license_check/rat-excludes
+++ b/tests/nightly/apache_rat_license_check/rat-excludes
@@ -58,4 +58,6 @@ moderngpu/*
 deformable_im2col.cuh
 deformable_im2col.h
 REQUIRE
-include/*
\ No newline at end of file
+include/*
+*/test/test-symbol.json.ref
+*/profiler/test/profile-matmul-20iter.json.ref
\ No newline at end of file

Reply via email to