-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
OhemCrossEntropyLoss explanation #3434
Comments
The purpose of min_kept in the code is to guarantee that there are sufficient pixels available for computing loss. I think it's particularly useful during the early stages of model training when the model is unable to generate predictions that contain clear difficult examples(They might be meaningless, just some random predictions. without min_kept, only fewer pixels are able to exceed threshold, and further impact the convergence speed of model).
The tensor label must have a data type of int64 to avoid errors with the value 255. The ignore_index parameter is employed to exclude certain classes, such as background and irrelevant task-related classes, from being used in loss computation. |
Thank you for your help ! |
以上回答已经充分解答了问题,如果有新的问题欢迎随时提交issue,或者在此条issue下继续回复~ |
@Asthestarsfalll thanks for the explanation of ignore_index. Let me ask you a couple of qustions here.
Thank you in advance! |
|
问题确认 Search before asking
请提出你的问题 Please ask your question
Hello and thank you for your work! I had a question regarding the hyperparameters of OhemCrossEntropy. By reading the code and documentation, I understood that there are 3 hyperparameters, including "threshold," which determines from what probability we consider an example difficult or not (e.g., thresh = 0.8, if we predict 0.6 = difficult example, 0.9 = valid example).
However, I'm having trouble understanding "min_kept." I don't quite grasp how it works. What is the difference between setting it to 10000 or 130000?
Regarding the "ignore_index," I'm confused because I'm getting an error with 255, whereas my annotations are binary, either 0 (background) or 1 (person), and there is no 255.
It would be amazing if someone could shed some light on the subject for me!
The text was updated successfully, but these errors were encountered: