Using Bayesopt to optimize a basic function

조회 수: 11 (최근 30일)
Aden Lee
Aden Lee 2020년 5월 15일
편집: Linan Huang 2022년 1월 3일
What are some examples on using bayesopt, to optimize a basic function, such as x sin x. As i was having problems when trying to find out how to use the objective functions in bayesopt

답변 (1개)

Linan Huang
Linan Huang 2022년 1월 3일
편집: Linan Huang 2022년 1월 3일
Here is an example of a simple 1D function that you can run BO directly to find the optimal.
The tricky part is to define the function handle that can deal with the BO variable, which is implicitly explained in the document.
var = optimizableVariable('theta',[1,10],'Type','real');
fun = @(x)objfunxx(x.theta); %Create Function Handles
results = bayesopt(fun,var)
function y = objfunxx(x)
y=x*sin(x);
end

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by