Raschka-research-group / coral-cnn

Rank Consistent Ordinal Regression for Neural Networks with Application to Age Estimation
https://www.sciencedirect.com/science/article/pii/S016786552030413X
MIT License
336 stars 62 forks source link

Variables' meaning #7

Closed tumbleintoyourheart closed 5 years ago

tumbleintoyourheart commented 5 years ago

Dear Sir,

First of all thanks for sharing this great repo

I have some questions. Hopefully, this will not bother you

In single-image-prediction/afad_coral.py, can you explain

  1. what do logits , probas and predicted_levels mean?
  2. why predicted_label = sum(predict_levels)?

I have had read the paper but still not been able to clarify those

Thank you for your time Sir

Originally posted by @tumbleintoyourheart in https://github.com/Raschka-research-group/coral-cnn/issues/6#issuecomment-528066010

rasbt commented 5 years ago

what do logits , probas and predicted_levels mean?

The logits are basically the inverse of the probabilities -- the name comes from logistic regression referring to the "natural logarithm of the odds" (log-odds). In the case of neural networks, people usually call the values before applying the last sigmoid or softmax activation the logits.

The "probas" are the class-membership probabilities then. The "P"'s here:

Screen Shot 2019-09-04 at 4 55 19 PM

Predicted levels are the binarized version of the probabilities. If the predicted probability is greater than 0.5 (more than 50%), it's 1, and 0 otherwise.

why predicted_label = sum(predict_levels)

The answer is basically also in the figure above, but to illustrate that with an example:

If you have 5 classes and the true label is 3, you may predict

Then, the predicted labels is 1+1+1+0=3.

Hope that helps!

tumbleintoyourheart commented 5 years ago

A very concise explanation. I appreciate it. My respect, Sir. Do you want me to close the issue or keep it open?

rasbt commented 5 years ago

Glad to hear that the explanation was helpful. I guess we can close this then.