-
Notifications
You must be signed in to change notification settings - Fork 224
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
Inappropriate StackOverflowError with unexpected array type #198
Comments
At one point we were making an effort to allow passing in arrays of arbitrary order. Would be good to see if we can restore some of that if it got lost in the API redesign. |
Additional note: optimize(f, [0.0 0.0]') also fails with a |
I suppose it is because the fallback function is called over and over again since no specialized method applies. Probably lines like this are the culprit: https://github.com/JuliaOpt/Optim.jl/blob/master/src/nelder_mead.jl#L53 . I do think I had a reason for narrowing it down to vectors here, especially because I didn't consistently do so: https://github.com/JuliaOpt/Optim.jl/blob/master/src/gradient_descent.jl#L36, but I can't think of a fundamental one. I guess that decision should be revisited Regardless, a Stackoverflow is not a graceful way to deal with an unsupported parameter setting. |
I don't see why this shouldn't be possible, and it should certainly have tests, as I was sure we allowed for this. Unless we can find a good reason, I think we (I, op, anyone) should restore the functionality. I've never had an obvious need for it myself, though I can imagine a few uses. |
Although I really wish it would be handled by something like #163 . If op doesn't do it, I'll try to make a pr asap. |
Okay, so I looked a bit into this.
I think this happened as a result of insufficient testing. For example, Additionally, it never works if you don't give it a gradient, as I will try to clean all of this up, but I'm not sure we can allow for the "no gradient case" and freely chosen |
When an
Array{Float64,2}
instead of aArray{Float64,1}
is passed to theoptimize
function aStackOverflowError
is thrown. A more helpful exception with a hint to the true reason for the error would be nice.Julia version 0.4.5 (2016-03-18 00:58 UTC)
The text was updated successfully, but these errors were encountered: