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

Documentation for SoftmaxWithLoss about label shape #6014

Open
dashesy opened this issue Oct 26, 2017 · 2 comments
Open

Documentation for SoftmaxWithLoss about label shape #6014

dashesy opened this issue Oct 26, 2017 · 2 comments

Comments

@dashesy
Copy link

dashesy commented Oct 26, 2017

Issue summary

The documentation for SoftmaxWithLoss is

@param bottom input Blob vector (length 2)

* -# equation

 *      the labels @f$ l @f$, an integer-valued Blob with values

But here in the code this is what is checked:

  CHECK_EQ(outer_num_ * inner_num_, bottom[1]->count())
      << "Number of labels must match number of predictions; "
      << "e.g., if softmax axis == 1 and prediction shape is (N, C, H, W), "
      << "label count (number of labels) must be N*H*W, "
      << "with integer values in {0, 1, ..., C-1}.";

So the documentation should have been:

* -# equation

@shaibagon
Copy link
Member

it is a little bit more complicated than that... The label shape depends on the axis parameter as well...

@dashesy
Copy link
Author

dashesy commented Nov 7, 2017

axis parameter should point to C. The only way that equation could be correct is if axis is -1 (last one). Even then, having C == 1 is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants