Thoroughly checking how optimoptions works in Matlab.
options = optimoptions (SolverName)
Things to do:
optim.options.Fmincon
What would be more appropriate, IMO, will be to have a function optimoptions of the following format
opts = function optimoptions(SolverName,varargin)
obj = optim.options.SolverName(varargin)
opts = struct(obj)
...
This function will
options = optimoptions (SolverName)
Things to do:
- Identify if Solver name is the right string or function handle
- Cater for multiple Algorithms
A subset of options for different algorithms. - Transfer relevant options of different solvers to modify/create option.
oldoptions = optimoptions('fmincon','TolX',1e-10)
newoptions = optimoptions('lsqnonlin',oldoptions) - Using dot notation or optimoptions to modify previously created options.
(Second argument in optimoptions can be old options) - Display options:
Set by user on top (for the current algo)
Default options
Options set for other algorithms.
Implementation ideas:
In Matlab, these two calls generate the same options object optim.options.Fmincon:
optimoptions('fmincon')
optimoptions('fmincon')
optim.options.Fmincon
What would be more appropriate, IMO, will be to have a function optimoptions of the following format
opts = function optimoptions(SolverName,varargin)
...
obj = optim.options.SolverName(varargin)
opts = struct(obj)
...
This function will
- Instantiate the relevant class and request for default options from the solver.
- Compare the user provided options to add relevant options.
- Display options of the current algorithm.
- The output can also be returned in the form of a struct to be compatible with optimget.
No comments:
Post a Comment