piiswrong commented on a change in pull request #7304: gluon bce & ctc losses
URL: https://github.com/apache/incubator-mxnet/pull/7304#discussion_r131713902
##########
File path: python/mxnet/gluon/loss.py
##########
@@ -239,3 +281,59 @@ def hybrid_forward(self, F, output, label,
sample_weight=None):
loss = label * (F.log(label+1e-8) - output)
loss = _apply_weighting(F, loss, self._weight, sample_weight)
return F.mean(loss, axis=self._batch_axis, exclude=True)
+
+class CTCLoss(Loss):
+ r"""Connectionist Temporal Classification Loss.
+
+ See `"Connectionist Temporal Classification: Labelling Unsegmented
+ Sequence Data with Recurrent Neural Networks"
+ <http://www.cs.toronto.edu/~graves/icml_2006.pdf>`_ paper for more
information.
+
+ The prediction output should be an activation vector without softmax, with
shape
+ according to the output_layout:
+ **TNC**: *(sequence_length, batch_size, alphabet_size + 1)*
+ **NTC**: *(batch_size, sequence_length, alphabet_size + 1)*
+ **out**: *(batch_size)*.
Review comment:
separate section for out and rename to loss
----------------------------------------------------------------
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