You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/06/07 19:43:15 UTC

[GitHub] [incubator-mxnet] daveliepmann commented on a change in pull request #15023: Extend Clojure BERT example

daveliepmann commented on a change in pull request #15023: Extend Clojure BERT example
URL: https://github.com/apache/incubator-mxnet/pull/15023#discussion_r291729851
 
 

 ##########
 File path: contrib/clojure-package/examples/bert/src/bert/bert_sentence_classification.clj
 ##########
 @@ -138,14 +162,16 @@
                                         {:label {label-desc (ndarray/array labels [train-num]
                                                                            {:ctx dev})}
                                          :data-batch-size batch-size})
-        model (m/module model-sym {:contexts [dev]
-                                   :data-names ["data0" "data1" "data2"]})]
-    (m/fit model {:train-data train-data  :num-epoch num-epoch
-                  :fit-params (m/fit-params {:allow-missing true
-                                             :arg-params (m/arg-params bert-base)
-                                             :aux-params (m/aux-params bert-base)
-                                             :optimizer (optimizer/adam {:learning-rate 5e-6 :episilon 1e-9})
-                                             :batch-end-callback (callback/speedometer batch-size 1)})})))
+        fitted-model (m/fit (m/module model-sym {:contexts [dev]
+                                                 :data-names ["data0" "data1" "data2"]})
+                            {:train-data train-data  :num-epoch num-epoch
+                             :fit-params (m/fit-params {:allow-missing true
+                                                        :arg-params (m/arg-params bert-base)
+                                                        :aux-params (m/aux-params bert-base)
+                                                        :optimizer (optimizer/adam {:learning-rate 5e-6 :epsilon 1e-9})
 
 Review comment:
   These were all pre-existing in the Clojure example, which AFAIK were in the non-Clojure example this was based on, which I assume were from the BERT paper but have no idea. :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services