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

 ##########
 File path: 
contrib/clojure-package/examples/bert/src/bert/bert_sentence_classification.clj
 ##########
 @@ -157,4 +183,42 @@
 (comment
 
   (train (context/cpu 0) 3)
-  (m/save-checkpoint model {:prefix "fine-tune-sentence-bert" :epoch 3}))
+
+  (m/save-checkpoint model {:prefix fine-tuned-prefix :epoch 3})
+
+  
+  ;;;; Explore results from the fine-tuned model
+
+  ;; We need a predictor with a batch size of 1, so we can feed the
+  ;; model a single sentence pair.
+  (def fine-tuned-predictor
+    (infer/create-predictor (infer/model-factory fine-tuned-prefix
+                                                 [{:name "data0" :shape [1 
seq-length] :dtype dtype/FLOAT32 :layout layout/NT}
+                                                  {:name "data1" :shape [1 
seq-length] :dtype dtype/FLOAT32 :layout layout/NT}
+                                                  {:name "data2" :shape [1]    
        :dtype dtype/FLOAT32 :layout layout/N}])
+                            {:epoch 3}))
 
 Review comment:
   Why do we need this hardcoded epoch number here? Can't we just use 
`num-epoch`?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to