Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
gigasquid committed Jan 25, 2019
1 parent 0e3fd7e commit 748286f
Showing 1 changed file with 22 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,40 @@
(do
(println "Starting Training of MNIST ....")
(println "Running with context devices of" devs)
(resource-scope/using
(let [_mod (m/module (get-symbol) {:contexts devs})]
(m/fit _mod {:train-data (mx-io/mnist-iter {:image (str data-dir "train-images-idx3-ubyte")
:label (str data-dir "train-labels-idx1-ubyte")
:label-name "softmax_label"
:input-shape [784]
:batch-size batch-size
:shuffle true
:flat true
:silent false
:seed 10
:num-parts num-workers
:part-index 0})
:eval-data (mx-io/mnist-iter {:image (str data-dir "t10k-images-idx3-ubyte")
:label (str data-dir "t10k-labels-idx1-ubyte")
(let [_mod (m/module (get-symbol) {:contexts devs})]
(m/fit _mod {:train-data (mx-io/mnist-iter {:image (str data-dir "train-images-idx3-ubyte")
:label (str data-dir "train-labels-idx1-ubyte")
:label-name "softmax_label"
:input-shape [784]
:batch-size batch-size
:shuffle true
:flat true
:silent false
:seed 10
:num-parts num-workers
:part-index 0})
:num-epoch _num-epoch
:fit-params (m/fit-params {:kvstore kvstore
:optimizer optimizer
:eval-metric eval-metric})})
(println "Finish fit")
_mod
))

))))
:eval-data (mx-io/mnist-iter {:image (str data-dir "t10k-images-idx3-ubyte")
:label (str data-dir "t10k-labels-idx1-ubyte")
:input-shape [784]
:batch-size batch-size
:flat true
:silent false
:num-parts num-workers
:part-index 0})
:num-epoch _num-epoch
:fit-params (m/fit-params {:kvstore kvstore
:optimizer optimizer
:eval-metric eval-metric})})
(println "Finish fit")
_mod
)))))

(defn -main [& args]
(let [[dev dev-num] args
devs (if (= dev ":gpu")
(mapv #(context/gpu %) (range (Integer/parseInt (or dev-num "1"))))
(mapv #(context/cpu %) (range (Integer/parseInt (or dev-num "1")))))]
(start devs)))
(resource-scope/using (start devs))))

(comment
(start [(context/cpu)]))

0 comments on commit 748286f

Please sign in to comment.