BayesOpt / doxygen / contribute.dox

/*!  \page contriblib Contribute to the library

\section addcomp Adding components

Thanks to the modular design, adding new components is very easy. Most
of the inner functions (kernels, criteria, etc.) are designed as
functors (function objects). Thus, we just need to inherit from the
interface (abstract) functor or one of the existing functions. The new
functor would be automatically integrated, including advanced usage
(for example: annealing).

Although it would be more efficient to use a template system. The
functors are instantiated dynamically using a factory model. This
allows changes without recompiling the library, which is specially
important while using dynamic languages (Python, Matlab, etc.).

\subsection addfunct Adding functors (kernels, criteria and mean functions)

The three elements follow the same structure. The interface (abstract
class) and the factory model are defined in the \c *_functors.hpp and
\c *_functors.cpp files, respectively.

Then, there are two types of functors: atomic and combined. Atomic
functors are used to define directly a function (e.g.: a Gaussian
kernel) and they return a value. Combined functors are used to combine
2 or more functors (e.g.: sum of kernels), which can be atomic or
combined (e.g.: a sum of products of kernels).

Combined kernels and mean functions only allows binary expressions -2
elements- while combined criteria support any number of elements (see
cHedge function in \ref combcri).

Finally, add the corresponding register with the new function name in
the Factory model in \c *_functors.cpp

\section modpy Modifying the Python interface:

Read this part <B>only if you need to modify</B> the Python interface.

\subsection instcython Install Cython:

First, you need to install Cython:

In \b Ubuntu/Debian, you can get it by running:
>> sudo apt-get install cython

In \b MacOS you can install macports and run:
>> sudo port install py27-cython

Or we can download it from the website: 

\subsection modcython Working with Cython:

The interface is defined in \c python/bayesopt.pyx file, which is
written in Cython, a mixture of C and Python code. For more
information, check the online documentation

Then, you need to run the Cython compiler.

$ cython --cplus bayesopt.pyx

which generates the file \c python/bayesopt.cpp, which can be directly
used in the library. Python would only find the library if it is
called exactly \c

\section relsoft Related software

\li Spearmint (Python): A library based on \cite Snoek2012. It is more oriented to cluster computing
\li Hyperopt (Python): A library mainly based on \cite Bergstra2011. It uses different models for the surrogate model
\li Perk (Fortran+Shell): A library for surrogate modelling. It was mainly used in \cite Santner03.
\li SUMO (Matlab): A library for surrogate modelling. Its main purpose it is not optimization but it also includes the Expected Imporvement algorithm.
\li GPML (Matlab): The most popular library for Gaussian Process. BayesOpt uses some of its design principles.
\li NLOPT (C-Many languages): One of the best libraries for general purpose nonlinear optimization.