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

Very high loss on using BCELoss #19

Open
prk-vinay opened this issue Jan 31, 2021 · 2 comments
Open

Very high loss on using BCELoss #19

prk-vinay opened this issue Jan 31, 2021 · 2 comments

Comments

@prk-vinay
Copy link

Hi,
I wanted to try your code on SWIMSEG dataset. It has only two classes- cloud and sky (background). I got IoU of 80%. But I wanted to BCELoss instead of CrossEntropyLoss so that I could reduce the number of output channels to just 1 instead of 2. Hence, I used use BCELoss (For this, I also introduced a sigmoid layer at the end of the model). The problem is that it is now giving huge error and output tensor is quickly moving towards 0, i.e., I am getting all the outputs as 0s. I tried changing learning rates. But it was not very helpful. Any idea, what's going wrong?

@prk-vinay prk-vinay changed the title Very high loss one using BCELoss Very high loss on using BCELoss Jan 31, 2021
@chenxi116
Copy link
Owner

Sorry I don't use BCELoss very often, so I don't have a good guess what might be the cause here. From the mathematical side of things, BCELoss looks doable to me.

@prk-vinay
Copy link
Author

Sorry I don't use BCELoss very often, so I don't have a good guess what might be the cause here. From the mathematical side of things, BCELoss looks doable to me.

Thanks for your reply. Is there any other loss function that I should consider for binary classification?

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

No branches or pull requests

2 participants