thomelane commented on a change in pull request #12951: Update Gluon example 
folder
URL: https://github.com/apache/incubator-mxnet/pull/12951#discussion_r230240565
 
 

 ##########
 File path: example/gluon/lstm_crf/lstm_crf.py
 ##########
 @@ -223,6 +224,8 @@ def forward(self, sentence):  # dont confuse this with 
_forward_alg above.
             # calling optimizer.step()
             neg_log_likelihood.backward()
         optimizer.step(1)
+        neg_log_likelihood_acc += neg_log_likelihood.mean()
 
 Review comment:
   Isn't `neg_log_likelihood_acc` always set back to 0 every batch? So 
`neg_log_likelihood_acc` is 0 or  `neg_log_likelihood.mean()`, and not 
accumulated?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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