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

Commit

Permalink
#13385 [Clojure] - updating tutorial mxnet version number to match o…
Browse files Browse the repository at this point in the history
…thers
  • Loading branch information
hellonico committed Dec 10, 2018
1 parent af4706b commit 0e32e40
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@

(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]
[org.apache.clojure-mxnet.executor :as executor]
[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 ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -58,9 +62,6 @@
(def data-path "data/obama.txt")
(def vocab (util/build-vocab data-path))

(when-not (.exists (io/file "data"))
(do (println "Retrieving data...") (sh "./get_data.sh")))

;; generate the symbol for a length
(defn sym-gen [seq-len]
(lstm/lstm-unroll num-lstm-layer seq-len (inc (count vocab))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

(ns rnn.core_test
(:require
[rnn.train-char-rnn] ; this will load the data files
[rnn.test-char-rnn :as rnn]
[clojure.test :refer :all]))

Expand Down
2 changes: 1 addition & 1 deletion contrib/clojure-package/examples/tutorial/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:description "MXNET tutorials"
:plugins [[lein-cljfmt "0.5.7"]]
:dependencies [[org.clojure/clojure "1.9.0"]
[org.apache.mxnet.contrib.clojure/clojure-mxnet "1.4.0-SNAPSHOT"]
[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"]
Expand Down

0 comments on commit 0e32e40

Please sign in to comment.