Open dmsorokin opened 10 months ago
thanks for reporting the issue, I will try to find time to look at this
It is true that the solution returned by the optimizer is wrong, but I don't think there's a real way around this problem. The issue is that the gradient of the objective function is identically zero to within numerical precision, which causes the solver to proclaim the initial point to be optimal. There's not much that can be done about that except for fiddling with the objective to make it more well-behaved numerically, which is the user's responsibility.
Replacing the function objective_func
in the above code snippet with the following
function objective_func(x) -sum(log.(x)) end
results in an equivalent optimization problem which does have a well-behaved objective function. Strangely enough, the solver now returns a point which violates the norm constraint: for example, for n_dim = 2, the result is [0.75, 0.75], when the actual minimizer is [0.707..., 0.707...].
Hi! I encountered this problem while working on a rather complicated optimization problem in 200+ dimensions: the result of a 'successful' optimization violated the constraint. I use IPNewton following this tutorial, but I rely on forward differentiation instead of calculating the gradient and the Hessian. The issue seems to be related to #813.
Here is a simple example I was able to cook up that demonstrates the failure of the optimization problem as the number of dimensions grows. The constraint is not violated in the example, but the solution is definitely wrong. The example below solves the problem correctly when
n_dims = 2
but fails whenn_dims = 200
.I hope this is helpful! Thanks.