Repository navigation
Getting Inexact Errors from NOMAD.jl when tuning Integer and Boolean variables #48
Copy link
Copy link
Closed
Description
I sometimes obtain the following error when using integer and boolean inputs. From my perspective, it seems to happen randomly, but I am not sure. I will sometimes rerun NOMAD.jl and I won't get an error. Here is a recent stacktrace:
ERROR: LoadError: InexactError: Bool(1.00000000000003) [29/1822]Stacktrace: [1] Bool @ ./float.jl:106 [inlined] [2] convert @ ./number.jl:7 [inlined] [3] set_default!(parameter::AlgorithmicParameter{Bool, BinaryRange{Bool}}, new_value::Float64)
@ Main ~/ParameterTuningInterface/src/parameters.jl:38
[4] (::var"#14#17")(::Tuple{AlgorithmicParameter{Bool, BinaryRange{Bool}}, Float64})
@ Main ./none:0
[5] iterate
@ ./generator.jl:47 [inlined]
[6] collect_to!(dest::Vector{Real}, itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{AlgorithmicParameter}, Vector{Float64}}}, var"#14#17"}, offs::Int64, st::Tuple{Int64, Int64})
@ Base ./array.jl:724
[7] collect_to!(dest::Vector{Int64}, itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{AlgorithmicParameter}, Vector{Float64}}}, var"#14#17"}, offs::Int64, st::Tuple{Int64, Int64})
@ Base ./array.jl:732
[8] collect_to_with_first!(dest::Vector{Int64}, v1::Int64, itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{AlgorithmicParameter}, Vector{Float64}}}, var"#14#17"}, st::Tuple{Int64, Int64})
@ Base ./array.jl:702
[9] collect(itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{AlgorithmicParameter}, Vector{Float64}}}, var"#14#17"})
@ Base ./array.jl:683
[10] obj
@ ~/ParameterTuningInterface/src/parameters.jl:103 [inlined]
[11] obj
@ ~/ParameterTuningInterface/src/parameters.jl:103 [inlined]To fix the issue, I had to do a convert(Bool, round(Int64, value)).
Any ideas? I am curious why it seems to happen arbitrarily.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Getting Inexact Errors from NOMAD.jl when tunin Integer and Boolean variables[/-][+]Getting Inexact Errors from NOMAD.jl when tuning Integer and Boolean variables[/+]salomonl commentedon Nov 3, 2021
@MonssafToukal Could you provide a simple blackbox example ?
amontoison commentedon Nov 4, 2021
@MonssafToukal Is it the output of the blackbox
1.00000000000003?Did you specify that it's a Boolean variable in NOMAD.jl ?
tmigot commentedon Nov 6, 2021
Hey @salomonl and @amontoison
I don't think there is something about specifying integer or boolean in the documentation that would be really a great add-on if that's possible with Nomad.jl!
salomonl commentedon Nov 6, 2021
https://bbopt.github.io/NOMAD.jl/dev/nomadProblem/ : see
input_types.But yes, we should precise that all inputs of a blackbox for
Nomadwill be considered asFloat64( for example,x1 = true=>x1 = 1). It is a convention of theC++interface, which makes it easy to implement different types.MonssafToukal commentedon Nov 6, 2021
Hi @salomonl ! Sorry for the late reply. Indeed, the
input_typesfor my boolean and my integer variables are respectively "B"and "I" as mentioned in the documentation. I will try to reproduce the error with a simple program.salomonl commentedon Oct 22, 2026
Closed :no feedback since 2021.