-
Notifications
You must be signed in to change notification settings - Fork 82
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
loss calculation of multi-label classification. #33
Comments
|
Thanks for clarifying sachin. One more thing loss output we get is 'mean' over a batch we multiply (losses.update) it with batch size to get batch loss which is ok. But precision and recall are already calculated for a batch then why it's again multiplied (prec.update, rec.update) by batch size as shown in below code?
|
There is nothing fancy here. If you don't do this, then the statistics computed for the entire dataset using batch-wise statistics may be different from sample-wise statistics (though not by huge margin).
For example, Let us say that you have following values in an array [1, 2, 3, 4, 5, 6] and let us say that you are using a batch size of 4 (so, you have [1, 2, 3, 4] and [5, 6] as two batches, one batch is truncated). In this case, sample-wise mean is 3.5 while batch-wise mean is 4.0 (mean(mean([1, 2, 3, 4]) + mean([5, 6])). Hope this helps |
Thanks for such a detailed reply. I didn't want to ask about object detection in this thread but didn't wanted to open new issue.
Is this done intentionally, if yes what were the benefits? |
I was too lazy to tune these priors, so used same across all scales. If you tune these, then your object detection would be much faster. |
Also, feel free to create a pull request to merge your changes |
Thanks for replying, sure thing !! |
i have raised a pull request, please check whether the code is correct. |
For multi classification, while calculating loss for coco dataset why it is multiplied by number of classes (80.0)? Is it weight parameter for class imbalance?
loss = criteria(output, target.float()) * 80.0
For calculating precision and recall should we use cumulative TP & FP as mentioned here:
https://github.com/rafaelpadilla/Object-Detection-Metrics
The text was updated successfully, but these errors were encountered: