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

Why avoid the loss of becoming negative #17

Open
SITUSITU opened this issue Aug 21, 2023 · 1 comment
Open

Why avoid the loss of becoming negative #17

SITUSITU opened this issue Aug 21, 2023 · 1 comment

Comments

@SITUSITU
Copy link

Thanks for your work and I have a question

Why can't the loss be negative? It seems to me that the value of the loss does not affect the training of the network.

As an example, let's say my loss is the cross-entropy loss, which is (0, 1) most of the time, and the optimization goal is to minimize the loss.

Now suppose I add a constant of -100 to the loss. Loss = loss-100. The loss will be (-100, -99), and the optimization goal remains the same: reduce the loss

The way to reduce the loss is gradient descent. Obviously, the constant -100 does not affect the gradient of the network parameters, that is, the loss does not seem to affect the training process, what is important is the gradient of this value to the network parameters.

Now back to the original question, why is it necessary to avoid negative losses?

@wufei-png
Copy link

Because the backpropagation process, the positive or negative of the loss determines the positive or negative of the gradient?

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