Comments (5)
Hey @MonssafToukal. NomadProblem
is indeed immutable, because it is simple for us to check that all parameters given to Nomad are valid (and prevent a segmentation fault in the c++ code). If you want to modify an option parameter, you can just do the following:
using NOMAD
parameters = [1.0, 2.0]
max_time=1 # a max time for a second.
bb_output(parameters::AbstractVector{Float64}) = begin
sleep(0.1) # force it to slow, otherwise under 1 second to end.
0
end
function obj(v::AbstractVector{Float64})
return true, true, bb_output(v)
end
nomad = NomadProblem(
length(parameters),
1,
["OBJ"],
obj;
input_types = ["R", "R"],
granularity = [0.0, 0.0],
lower_bound = [0.0, 0.0],
upper_bound = [10.0, 10.0])
# your parameters.
nomad.options.display_all_eval=true
nomad.options.display_infeasible=true
nomad.options.max_time=max_time
solve(nomad, [2.0, 2.0])
On my machine, I get
BBE OBJ
1 0 *
2 0
3 0
4 0
5 0
A termination criterion is reached: Maximum allowed time reached (Base) No more points to evaluate
Best feasible solution: #1 ( 2 2 ) Evaluation OK f = 0 h = 0
Best infeasible solution: Undefined.
Blackbox evaluations: 5
from nomad.jl.
Thank you for the quick reply! You can definitely modify the attributes of NomadOptions
directly. Maybe we could pass arguments like so in the NomadProblem
constructor:
function NomadProblem(nb_inputs::Int,
nb_outputs::Int,
output_types::Vector{String},
eval_bb::Function;
input_types::Vector{String} = ["R" for i in 1:nb_inputs],
granularity::Vector{Float64} = zeros(Float64, nb_inputs),
lower_bound::Vector{Float64} = -Inf * ones(Float64, nb_inputs),
upper_bound::Vector{Float64} = Inf * ones(Float64, nb_inputs),
A::Union{Nothing, Matrix{Float64}} = nothing,
b::Union{Nothing, Vector{Float64}} = nothing,
min_mesh_size::Vector{Float64} = zeros(Float64, nb_inputs),
initial_mesh_size::Vector{Float64} = Float64[],
kwargs...)
...
...
return new(nb_inputs, nb_outputs, input_types,
granularity, min_mesh_size, initial_mesh_size,
lower_bound, upper_bound,
output_types, A, b, eval_bb, NomadOptions(;kwargs...))
That way, we could also pass arguments like this: nomad = NomadProblem(length(parameters), 1, ["OBJ"];display_all_eval=true)
. Do you think that could work?
from nomad.jl.
This is just an idea. I am just wondering if that could be easier for the user to set the options in the NomadProblem
constructor. You did mention that it is currently implemented like that to prevent seg faults so I don't know if that can have an impact.
from nomad.jl.
We will think about that. I do not really like the kwargs
argument, as it is not enough restrictive for us to prevent an user to enter wrong arguments. Otherwise, when you create a NomadProblem
, the options are put by default. As I suppose you will not try to change all of them, you can just fix the ones that are indicated in the documentation via nomad.options.your_option=your_choice
.
from nomad.jl.
Ok! Thanks for the clarification and your quick responses.
from nomad.jl.
Related Issues (20)
- Trouble installing HOT 2
- How to add minimum mesh size? HOT 5
- Add support for linear equality constraints
- Update the interface to support NOMAD4 options HOT 1
- TagBot trigger issue HOT 8
- How to use biobjective function in NOMAD.jl HOT 3
- NOMAD segfaults on Manjaro Linux when Julia is started with "-t n" with n>1 HOT 23
- pkg> test NOMAD fails on FreeBSD 13 HOT 15
- Add documentation about NOMAD executable
- [documentation] SOLAR and STYRENE
- Getting Inexact Errors from NOMAD.jl when tuning Integer and Boolean variables HOT 5
- `max_time` as an integer HOT 2
- Remove Union{Nothing, Int} in the interface
- Use surrogate models HOT 1
- Parallel evaluation of the black-box HOT 1
- SubproblemManager HOT 9
- Relationship between the granularity and the min_mesh_size of a NomadProblem HOT 1
- Release 2.3.0 HOT 1
- NOMAD_jll has .so libraries instead of .dylib on FreeBSD
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nomad.jl.