Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added required doc for categorical cross entropy #870

Merged
merged 1 commit into from
Sep 8, 2017

Conversation

Sentient07
Copy link
Contributor

@Sentient07 Sentient07 commented Jul 29, 2017

Fixes #591

"""Computes the categorical cross-entropy between predictions and targets.
"""Computes the categorical cross-entropy between predictions $p_{i,j}$
and targets $t_{i,j}$, where $i$ denotes the data point and $j$
denotes the class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, but you completely messed up the formatting :)

a) the first sentence must be short since it's used for the overview table
b) the text must not be indented otherwise it's assumed to be a code block
c) the math syntax in Sphinx does not use $

Please always compile and look at the documentation when changing docstrings in a nontrivial way: http:https://lasagne.readthedocs.io/en/latest/user/development.html#documentation

So the explanation of p, t, i, j should come after the formula, or in a second sentence before the formula, not in the first sentence.

@@ -157,6 +159,8 @@ def categorical_crossentropy(predictions, targets):
targets : Theano 2D tensor or 1D tensor
Either targets in [0, 1] matching the layout of `predictions`, or
a vector of int giving the correct class index per data point.
In the case of an integer vector argument, each element
represents the position of the '1' in a 1-of-N encoding.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it extra clear. Good!

@Sentient07
Copy link
Contributor Author

I've pushed a commit with the suggested changes. Here's how the doc looks,
screenshot at aug 14 04-19-10

@Sentient07
Copy link
Contributor Author

Sorry about that, there was a PEP8 error. Fixed that and committed. Once this PR is LGTM(to @f0k ), I will squash all the commits into one

@f0k
Copy link
Member

f0k commented Sep 8, 2017

Modified the formulation, corrected the punctuation and squashed it. Hope you don't mind, it was easier this way. Thanks again, merging!

@f0k f0k merged commit ad94952 into Lasagne:master Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants