JuliaLinearAlgebra / NonNegLeastSquares.jl

Some nonnegative least squares solvers in Julia
MIT License
46 stars 11 forks source link

admm method does not always terminate #4

Closed rdeits closed 7 years ago

rdeits commented 7 years ago

Certain inputs appear to cause the admm method to run forever (or at least for more than 10 minutes). You should be able to reproduce this with:

julia> A = readdlm(IOBuffer("""-0.6140157684184999        -0.18575400752297253        -0.039089369181453684        -0.723594080463341        -0.5505315425442738        1.932103925281995        -0.5228611507815946
       -0.6765094479105879        0.5694062927390149        0.9478234685929882        -0.9762265450619104        0.8626736016768348        -0.6190975415527373        1.6669119253019533
       -0.05037926599513071        0.6291526009393537        0.3787637429698142        0.6350611141876433        -0.9033259651375771        1.6289059639630827        0.5954161895572425
       """));

julia> b = readdlm(IOBuffer("""1.2513016915352937
       0.38560703915895395
       -1.070018084353419
       """));

julia> nonneg_lsq(A, b; alg=:admm)

I believe this is why the Travis tests stall with some probability.

ahwillia commented 7 years ago

Does increasing the epsilon (tolerance) parameter solve this?

rdeits commented 7 years ago

Yeah (once I realized that the tolerance was \upepsilon not \varepsilon; fortunately Julia v0.6 treats them as the same character). For this particular problem, the residual hovers around 8e-15 to 1e-14 and never seems to get any lower.

ahwillia commented 7 years ago

Does #5 look like a reasonable solution? We could also bump the default tolerance.

rdeits commented 7 years ago

Yeah, I think a max iteration limit is totally reasonable.