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
Numerical issue with entropy regularization in generic_conditional_gradient
#502
Comments
G should not contain negative value by construction (it is a scaled gaussian kernel when using sinkhorn) so this should not occur. Could you have a look at what is happening? Maybe we get steps in the FW that are larger that 1? |
Yeah, that's why I was confused with this. I will try to find why exactly this happens. |
It turns out that f(xk0 + alpha10 * pk0) to get value outside of the interpolation range (in our case, this "outside" happens to have negative values as it would be expected because matrix This is somewhat unexpected behavior from One possible solution to this would be to check if |
Ouch this one is subtle. Since Are you saying that in the function sometime the gradient is not an ascent direction? This is possible since at each iteration we solve a sinkhorn that might not have converged, in this case setting a step of 0 (because numerical precision prevents us to get descent direction) seems reasonable. |
I can surely add additional check into the callback function. I still don't have an intuitive feeling for this to be the right solution, though. I will run more tests. |
So, this is from the debugger. I'm just evaluating
|
Describe the bug
ot.optim.generic_conditional_gradient
uses the following cost function for line search (whenreg2
is provided):When matrix
G
contains negative values,nx.log(G)
returnsnan
with aRuntimeWarning
.Code sample
This example is used for
test_sinkhorn_l1l2_transport_class
in test/test_da.py.Expected behavior
The question now is negative values are expected to happen while performing line search? If yes, should we evaluate the cost to
-inf
in this case? Or is it okay for the cost to benan
(if this is the case, we should short-circuit the call to avoid warnings).Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: