Skip to content
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

Multiple Starting Points for MATLAB interface #170

Open
stumarcus314 opened this issue May 23, 2024 · 4 comments
Open

Multiple Starting Points for MATLAB interface #170

stumarcus314 opened this issue May 23, 2024 · 4 comments

Comments

@stumarcus314
Copy link

Is it possible to provide multiple starting points to NOMAD through the MATLAB interface in the parameter X0? I get the error below when I try to provide 2 starting points, each in its own row of X0.

N = 3; % Number of binary variables.
xtype_new = strcat('(',repmat('B ',1,N),')');
NOMAD_params = struct('display_degree','2','display_all_eval','no','bb_output_type','OBJ','bb_input_type',xtype_new);
lb = zeros(1,N); % Lower bounds on variables.
ub = ones(1,N); % Upper bounds on variables.
X0 = randi([0 1],2,N); % A pair of random initial starting points, each in a row of X0.
nomadOpt(META_cf,X0,lb,ub,NOMAD_params);

Error using nomadOpt
lb is not the same length as x0! Ensure they are both Column Vectors

@ctribes
Copy link
Contributor

ctribes commented May 23, 2024

You can try

NOMAD_params = struct('display_degree','2','display_all_eval','no','bb_output_type','OBJ','bb_input_type',xtype_new,'X0','x0s.txt');

With x0s.txt a file containing one x0 point per line.

@stumarcus314
Copy link
Author

That seems to work. Thanks. The following MATLAB code writes the matrix of starting points X0 to a text file called 'x0s.txt' with space delimiters.

writematrix(X0,'x0s.txt','Delimiter','space');

@stumarcus314
Copy link
Author

stumarcus314 commented May 23, 2024

Does NOMAD internally maintain a population of good solutions, or does it only operate on the best known solution? For example, if the starting points in the matrix X0 have already been evaluated in the objective function, maybe it only makes sense to provide NOMAD with the best of the starting points rather than all of them. For a genetic algorithm, it is often beneficial to provide a population of good starting points, from which other candidate points are generated.

@ctribes
Copy link
Contributor

ctribes commented May 24, 2024

In Nomad we keep all solutions.
When several x0s are provided, they are all evaluated. The poll and search steps are centered around the best feasible and infeasible solutions.
But Nomad uses all solutions to build quadratic models (used by default). Which can help improving objective function reduction.
Also, the good solution around the current bests (feasible and infeasible) are used by the Nelder-Mead search method (used by default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants