-
Notifications
You must be signed in to change notification settings - Fork 32
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
stack overflow using Optim.jl with Double64 #81
Comments
Thank you for bringing this to my attention. I have found the cause. I am bringing this to their attention too, so you can have this work properly. |
The issue (stack overflow) is probably due to this line: ini_dec(x::Real, n::Int, digits) = ini_dec(float(x),n,digits) where |
Who wrote it or who would know why the _dec functions are separated as they are and have fallbacks the way they do? |
It was @StefanKarpinski in 2014! |
It was stefan in 2012, that's just when they got moved into stdlibs. |
ahh do you recall why that function is there and how to cobble it? |
Not really but I can take a look. |
It is not clear if that is the only one of ?the three? similar tied-together functions that end |
fixed in master, merge v0.9.5 pending |
Thanks!
… On Aug 11, 2019, at 12:28 AM, Jeffrey Sarnoff ***@***.***> wrote:
fixed in master, merge v0.9.5 pending
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
using current versions of Optim and DoubleFloats on v1.2.0-rc2
julia> using Optim
julia> using DoubleFloats
example from Optim web page
julia> f(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
f (generic function with 1 method)
julia> optimize(f, [Double64(0.0), Double64(0.0)])
Status: success
Candidate solution
Error showing value of type Optim.MultivariateOptimizationResults{NelderMead{Optim.AffineSimplexer,Optim.AdaptiveParameters},Float64,Array{DoubleFloat{Float64},1},DoubleFloat{Float64},DoubleFloat{Float64},Array{OptimizationState{DoubleFloat{Float64},NelderMead{Optim.AffineSimplexer,Optim.AdaptiveParameters}},1},Bool}:
ERROR: StackOverflowError:
Stacktrace:
[1] ini_dec(::DoubleFloat{Float64}, ::Int64, ::Array{UInt8,1}) at ./printf.jl:1008 (repeats 80000 times)
same example with BigFloat
julia> optimize(f, [BigFloat(0.0), BigFloat(0.0)])
Status: success
Candidate solution
Minimizer: [1.00e+00, 1.00e+00]
Minimum: 3.525527e-09
Found with
Algorithm: Nelder-Mead
Initial Point: [0.00e+00, 0.00e+00]
Convergence measures
√(Σ(yᵢ-ȳ)²)/n ≤ 1.0e-08
Work counters
Iterations: 60
f(x) calls: 118
The text was updated successfully, but these errors were encountered: