GithubHelp home page GithubHelp logo

methodsofmachinelearning / entropy-search Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 7.0 1.9 MB

Entropy Search for Information-Efficient Global Optimization - JMLR v13

License: Other

CMake 0.17% C++ 71.35% C 3.76% M 0.02% MATLAB 16.04% HTML 1.55% CSS 0.01% Makefile 0.14% Fortran 6.98%

entropy-search's Introduction

Entropy Search for Information-Efficient Global Optimization

VERSION 1.1 - March 2017

This repository contains a Matlab implementation and demonstration for the global optimization algorithm called Entropy Search, as described in the initial JMLR publication

Authors

  • Philipp Hennig & Christian Schuler, 2011
  • Robert Eisele, 2014-2015
  • Edgar D. Klenske, 2017

Demo Experiment

An example script can be found in ExampleSetup.m, it tries to find an optimum for the Rosenbrock function and plots the resulting Gaussian process afterwards.

Running Entropy Search

From the Matlab subdirectory, you should be able to call

EntropySearch(in), where

in.covfunc      = {@covSEard};       % GP kernel  
in.covfunc_dx   = {@covSEard_dx_MD}; % derivative of GP kernel. You can use covSEard_dx_MD and covRQard_dx_MD if you use Carl's & Hannes' covSEard, covRQard, respectively.  
in.hyp          = hyp;  % hyperparameters, with fields .lik (noise level) and .cov (kernel hyperparameters), see documentation of the kernel functions for details.  
in.xmin         = xmin; % lower bounds of rectangular search domain  
in.xmax         = xmax; % upper bounds of rectangular search domain  
in.MaxEval      = H;    % Horizon (number of evaluations allowed)  
in.f            = @(x) f(x) % handle to objective function  

That handle @f is obviously the core part of the problem. If you use this method for actual experimental design, use the "PhysicalExperiment" function handle, which simply prompts for user input at the selected locations.

Dependencies

  • the Matlab optimization toolbox. If you do not have this, you can go through the code and replace calls to fmincon with fminbnd (much less efficient), or with a call to minimize.m (which you can get from http://www.gaussianprocess.org/gpml/code/matlab/util/minimize.m). But note that minimize does not automatically handle linear constraints. You can implement those naively by changing function handles such that they return +inf whenever evaluated outside the bounds.

All other dependencies (Eigen, logsumexp, tprod) are currently part of this repository.

Compiling

Part by part, the code of Entropy Search will be replaced by cpp/mex implementations to achieve a considerable speedup. The Matlab version of the replaced code resides in the util subdirectory, while the c++ implementation is in cpp. To compile, run the script compile_utilities.m. The mex-files take precedence over the Matlab implementation.

Copyright & license

2011-2017 (c) Max Planck Society. Released under the MIT License.

entropy-search's People

Contributors

eklenske avatar raffienficiaud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

entropy-search's Issues

Problem at first execution

Hello, I recently started working on the topic of entropy search. I would like to test your implementation, but I already got the following error after exetution of "ExampleSetup.m".

>> ExampleSetup
executing gpml startup script...
starting entropy search.

iteration number 1
sampling at random

iteration number 2
generating belief and evaluation points.
calling matlab joint_min
evaluating p(x_min)#####Compiling tprod for first use
Building with 'MinGW64 Compiler (C)'.
Undefined function or variable 'out'.
Error in EntropySearch (line 207)
            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. 

I'm using MATLAB 2018b and MINGW64 for mex-compiling. I usually have no problems with my mex-complier. However in this case I could trace back the error to line 144 of file "tprod.m", where an initial mex-compilation process is started. Any ideas how I can fix this error?

The readme says that "The Matlab version of the replaced code resides in the util subdirectory", this is not the case, right?

Best regards

Edit: Looks like this is a commen problem with tpod these days (ref. https://de.mathworks.com/matlabcentral/fileexchange/16275-tprod-arbitary-tensor-products-between-n-d-arrays). Any idea for a workaround?

Struct contents reference from a non-struct array object.

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.

GP.K not positive definite

Hello!
I regularly get this warning:

 Warning: Inference method failed [Error using chol Matrix must be positive definite.] .. attempting to continue
 In gp (line 120)
   In SEGammaHyperPosterior (line 4)
   In EntropySearch>@(x)in.HyperPrior(x,GP.x,GP.y) (line 197)
   In minimize>f (line 200)
   In minimize>lineSearch (line 136)
   In minimize>BFGS (line 82)
   In minimize (line 56)
(...)

This does not lead to a crash, but seems to be connected to a more severe problem. After a larger amount of iterations (occurred at more than 80) I get these errors, which lead to a crash

an error occured. evaluating function at random location 
Matrix must be positive definite.
(...)
Error using chol
Matrix must be positive definite.

Error in EntropySearch (line 273)
        GP.cK             = chol(GP.K);


Error in GPO (line 32)
result = EntropySearch(in);

The error and crash are reproducible.
My objective function yields costs from 0-300 and my parameter space is 10-dimensional. The covariance function and the hyperparameters are the same as for the ExampleSetup. Thank you for your help.

Compatibility issue with MATLAB function 'mexSetTrapFlag' in 'tprod_mex.c' file.

Thanks for providing this fabulous code. However, I am countering one issue resulted from MATLAB version R2018. When I tried to run the file ExampleSetup.m, it showed the error that 'mexSetTrapFlag' function has been removed since MATLAB R2018, which is called in c-file 'tprod_mex.c' in line 332 and 438. MATLAB pages told me that the function 'mexSetTrapFlag' can be replaced by 'mexCallMATLABWithTrap' which is more flexible. But I am not sure how to edit this change. Is it possible if this problem could be fixed? Thank you so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.