MethodsOfMachineLearning/entropy-search

Struct contents reference from a non-struct array object.

Closed this issue · 6 comments

when I run the ExamleSetup.m, there is always an error below.

206 catch error
207 if numiter > 1
208 out.FunEst(numiter,:) = out.FunEst(numiter-1,:);
Struct contents reference from a non-struct array object.

Error in EntropySearch (line 208)
out.FunEst(numiter,:) = out.FunEst(numiter-1,:);

Error in ExampleSetup (line 38)
result = EntropySearch(in); % the output is a struct which contains GP datasets, which can be evaluated with the gpml
toolbox.

This is a generic error. The most likely cause may be that your objective function returns NaNs or Infs. Could you check that your objective is well-formed over the search domain?

Thanks Philipp for your prompt reply.
This is Vu Nguyen from Deakin University, Australia.

I used your default objective function and tried to run the demo.
I have tried both objective functions:
in.f = @(x) GaussProcess(x); % handle to objective function
and
in.f = @(x) Rosenbrock(x); % handle to objective function

but both of them returns the same error.

I was testing using Matlab 2016b and Matlab 2017a in Windows.

Ok. Are you sure you compiled the C++ routines using the compile_utilities.m script?

I use compile_utilities.m to compile the C++ routines, but I couldnot compile because it returns errors, such as
error C2065: 'M_SQRT1_2': undeclared identifier
error C2065: 'M_SQRT1_2': undeclared identifier
...

However, the joint_min.m function can be called directly without depending on those C++ functions. Thus, I donot think that the problem comes from the C++ files.

That might be it. Another problem may be that you don't have the optimization toolbox? Try to run

dbstop if error;
ExampleSetup()

then, when the error occurs, look at the actual error (just type 'error' while in the debugger). That will probably provide helpful information.