# [incubator-mxnet] branch master updated: Clarify definition of cross-entropy metric in the documentation (clean up PR #7291) (#7365)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
new 44c2bfe  Clarify definition of cross-entropy metric in the
documentation (clean up PR #7291) (#7365)
44c2bfe is described below

commit 44c2bfe6133ae51cfb0531600ccd6408654434e6
Author: Hessel Tuinhof <hesseltuin...@users.noreply.github.com>
AuthorDate: Wed Aug 9 02:25:48 2017 +0200

Clarify definition of cross-entropy metric in the documentation (clean up
PR #7291) (#7365)

* [R] switch order of LRN and pooling layer

Original paper (section 3.5) performs local response normalization of relu.

* clearify definition of cross entropy

* fix small type

* fixed lint, trailing wspace
---
python/mxnet/metric.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/metric.py b/python/mxnet/metric.py
index 1a8e67d..00cc2da 100644
--- a/python/mxnet/metric.py
+++ b/python/mxnet/metric.py
@@ -854,10 +854,14 @@ class RMSE(EvalMetric):
class CrossEntropy(EvalMetric):
"""Computes Cross Entropy loss.

-    The cross entropy is given by
+    The cross entropy over a batch of sample size :math:N is given by

.. math::
-        -y\\log \\hat{y} + (1-y)\\log (1-\\hat{y})
+       -\\sum_{n=1}^{N}\\sum_{k=1}^{K}t_{nk}\\log (y_{nk}),
+
+    where :math:t_{nk}=1 if and only if sample :math:n belongs to class
:math:k.
+    :math:y_{nk} denotes the probability of sample :math:n belonging to
+    class :math:k.

Parameters
----------

--
['"comm...@mxnet.apache.org" <comm...@mxnet.apache.org>'].