Update `optimize` API
jmejia8 opened this issue · 2 comments
jmejia8 commented
The optimize
API will be extended mainly to:
- Handle starting points.
- Define complex search spaces (e.g., mixed-integer variables)
Starting Solutions
# example 1
optimize(f, [0.1, 0.3, -1.5], OPTIMIZER)
# example 2
optimize(f, StartingSolution([0.1, 0.3, -1.5]), OPTIMIZER)
Search Space
# current implementation
optimize(f, bounds, OPTIMIZER)
# new
optimize(f, SearchSpace(...), OPTIMIZER)
The search space can be defined as follows:
SearchSpace(bounds)
SearchSpace(Bool, 10) # Bit arrays with size 10
SearchSpace(integer_variables=bounds_int, real_variables=bounds_float) # for mixed-integer problems.
SearchSpace(:x => [-1.0, 1.0], :y => [0, 100]) # other possible application
jbytecode commented
nice design, but this breaks previous uses right? A new breaking version or making it backward compatible somehow?
jmejia8 commented
It could be an extension for implementing newer optimizers solving different problems (e.g., dynamic optimization, mixed-integer optimization, etc). There are no plans to remove the current optimize
API but extended it.