# Baysian Optimisation. Any way of increasing the sample size of candidates solutions to satisfy XConstraintFunction in bayesopt()?

3 views (last 30 days)

Show older comments

##### 2 Comments

LANG Wu
on 3 May 2021

Hi Bob,

Have you solved the issue that passing InitialX to the constraint function?

Thanks,

Lang

### Accepted Answer

Don Mathis
on 6 Oct 2017

Unfortunately the API doesn't allow that, but you can assign into the Options object once you have one. The bayesopt function creates one right away, so you could do something like this:

x = optimizableVariable('x',[-8,8]);

fun = @(T)sin(T.x);

BO = my_bayesopt(fun, x)

function Results = my_bayesopt(ObjectiveFcn, VariableDescriptions, varargin)

Options = bayesoptim.BayesoptOptions(ObjectiveFcn, VariableDescriptions, varargin);

Options.NumRestartCandidates = 1e6;

Results = BayesianOptimization(Options);

end

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!