You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by cm...@apache.org on 2019/07/19 17:24:49 UTC

[incubator-mxnet] 02/05: wip working

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

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

commit f64dd20a19131a1e85493603e7ec3e6f8ec930d7
Author: gigasquid <cm...@gigasquidsoftware.com>
AuthorDate: Sun Jul 7 17:02:00 2019 -0400

    wip working
---
 contrib/clojure-package/examples/gan/src/gan/auto_encoder.clj | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/clojure-package/examples/gan/src/gan/auto_encoder.clj b/contrib/clojure-package/examples/gan/src/gan/auto_encoder.clj
index 9bbbb3b..ee1a9a6 100644
--- a/contrib/clojure-package/examples/gan/src/gan/auto_encoder.clj
+++ b/contrib/clojure-package/examples/gan/src/gan/auto_encoder.clj
@@ -75,11 +75,18 @@
 
   (mx-io/provide-data train-data)
   (mx-io/provide-label train-data)
+  (mx-io/reset train-data)
   (def my-batch (mx-io/next train-data))
   (def images (mx-io/batch-data my-batch))
-  (ndarray/shape (first images))
+  (ndarray/shape (ndarray/reshape (first images) [100 1 28 28]))
   (viz/im-sav {:title "first" :output-path "results/" :x (first images)})
+  (viz/im-sav {:title "cm-first" :output-path "results/" :x (ndarray/reshape (first images) [100 1 28 28])})
 
+
+  (def preds (m/predict-batch my-mod {:data images} ))
+  (ndarray/shape (ndarray/reshape (first preds) [100 1 28 28]))
+    (viz/im-sav {:title "cm-preds" :output-path "results/" :x (ndarray/reshape (first preds) [100 1 28 28])})
+  
   (def my-metric (eval-metric/mse))
 
 
@@ -119,6 +126,7 @@
     ;;;high level score (returs the eval values)
     (let [score (m/score mod {:eval-data test-data :eval-metric (eval-metric/accuracy)})]
       (println "High level predict score is " score)))
+