Interpolate Matlab inbuilt function with Julia
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi, I have a problem when I try to interpolate Matlab inbuilt function bayesopt with Julia function, in my program, I try to use julia to evaluate my objective function, since it's fast, but I also want to use matlab bayesopt to optimize it, since julia's package is not that complete, it's almost work, but has a problem with variable type, here is an simple example, and the error as follows,
using MATLAB
function f(x, y)
return -x - y
end
function mdlfun(tbl)
x = tbl.v1
y = tbl.v2
return f(x, y)
end
mat"""
xrange = optimizableVariable('v1',[-2,2],'Type','real');
yrange = optimizableVariable('v2',[-5,5],'Type','real');
var=[xrange yrange];
bayesObject =bayesopt(@(tbl)$mdlfun(tbl),var,...
'MaxObjectiveEvaluations',50)
"""
Unable to use a value of type table as an index.
Error in @(tbl)matlab_jl_2(tbl)
Error in BayesianOptimization/callObjNormally (line 2576)
Objective = this.ObjectiveFcn(conditionalizeX(this, X));
Error in BayesianOptimization/callObjFcn (line 481)
= callObjNormally(this, X);
Error in BayesianOptimization/runSerial (line 1996)
ObjectiveFcnObjectiveEvaluationTime, ObjectiveNargout] = callObjFcn(this, this.XNext);
Error in BayesianOptimization/run (line 1948)
this = runSerial(this);
Error in BayesianOptimization (line 457)
this = run(this);
Error in bayesopt (line 323)
Results = BayesianOptimization(Options);
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Building and Assessment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!