This is an automated email from the ASF dual-hosted git repository. cmeier pushed a commit to branch clojure-bert-sentence-pair-classification in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
commit cb8ff3b0cd0e90aa0e5e900e3a6bf324b111bdfb Author: gigasquid <[email protected]> AuthorDate: Fri Apr 19 17:49:38 2019 -0400 clean up extra stuff --- .../src/bert_qa/bert_sentence_classification.clj | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/contrib/clojure-package/examples/bert-qa/src/bert_qa/bert_sentence_classification.clj b/contrib/clojure-package/examples/bert-qa/src/bert_qa/bert_sentence_classification.clj index 7f6723e..b7d4425 100644 --- a/contrib/clojure-package/examples/bert-qa/src/bert_qa/bert_sentence_classification.clj +++ b/contrib/clojure-package/examples/bert-qa/src/bert_qa/bert_sentence_classification.clj @@ -28,31 +28,6 @@ (def seq-length 128) - - -;;; Data preprocessing - -#_(defn fit [devs msymbol arg-params aux-params] - (let [mod (-> (m/module msymbol {:contexts devs}) - (m/bind {:data-shapes (mx-io/provide-data-desc train-iter) :label-shapes (mx-io/provide-label-desc val-iter)}) - (m/init-params {:arg-params arg-params :aux-params aux-params - :allow-missing true}))] - (m/fit mod - {:train-data train-iter - :eval-data val-iter - :num-epoch 1 - :fit-params (m/fit-params {:intializer (init/xavier {:rand-type "gaussian" - :factor-type "in" - :magnitude 2}) - :batch-end-callback (callback/speedometer batch-size 10)})}))) - -#_(defn fine-tune! [devs] - (let [{:keys [msymbol arg-params aux-params] :as model} (get-model) - new-model (fine-tune-model (merge model {:num-classes 2}))] - new-model - #_(fit devs net new-args arg-params))) - - (defn pre-processing [ctx idx->token token->idx train-item] (let [[sentence-a sentence-b label] train-item ;;; pre-processing tokenize sentence @@ -116,11 +91,6 @@ :dtype dtype/FLOAT32 :layout layout/NT}]) - #_(def base-mod (-> bert-base - (m/bind {:data-shapes input-descs}) - (m/init-params {:arg-params arg-params :aux-params aux-params - :allow-missing true}))) - ;;; Data Preprocessing for BERT ;; For demonstration purpose, we use the dev set of the Microsoft Research Paraphrase Corpus dataset. The file is named ‘dev.tsv’. Let’s take a look at the raw dataset.
