Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

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

Merged
merged 5 commits into from
Aug 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/mxnet/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,14 @@ def update(self, labels, preds):
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
----------
Expand Down