Commit 8410d8d9 authored by Jean-Baptiste Mouret's avatar Jean-Baptiste Mouret
Browse files

[doc] minor improvements

parent 0a5a5a7b
......@@ -228,7 +228,7 @@ Utility functions & typedefs
:members:
Models (model)
Models / Gaussian processes (model)
---------------
Currentl, Limbo only include Gaussian processes as models. More may come in the future.
......@@ -327,6 +327,12 @@ Default parameters
.. doxygengroup:: stop_defaults
:undoc-members:
Internals
^^^^^^^^^^
.. doxygenstruct:: limbo::stop::ChainCriteria
:members:
Statistics (stats)
--------------------------
......
......@@ -19,7 +19,7 @@ namespace limbo {
Exponential kernel with a :math:`\sigma` parameter that controls the width (see :cite:`brochu2010tutorial` p. 9).
.. math::
k(v_1, v_2) = \exp (-\frac{1}{\sigma^2} ||v_1 - v_2||^2)
k(v_1, v_2) = \exp \Big(-\frac{1}{\sigma^2} ||v_1 - v_2||^2\Big)
Parameters:
- ``double sigma``
......
......@@ -22,10 +22,19 @@ namespace limbo {
Matern kernel (TODO: formula)
.. math::
d = ||v1 - v2||
\nu = 5/2
C(d) = \sigma^2\frac{2^{1-\nu}}{\Gamma(\nu)}\Bigg(\sqrt{2\nu}\frac{d}{l}\Bigg)^\nu K_\nu\Bigg(\sqrt{2\nu}\frac{d}{l}\Bigg),
Parameters:
- ``double sigma``
- ``double l``
Reference: :cite:`matern1960spatial` & :cite:`brochu2010tutorial` p.10 & https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function
\endrst
*/
template <typename Params>
......
......@@ -9,6 +9,7 @@ namespace limbo {
namespace defaults {
struct kernel_maternthreehalfs {
/// @ingroup kernel_defaults
/// This is is sigma squared!
BO_PARAM(double, sigma, 1);
/// @ingroup kernel_defaults
BO_PARAM(double, l, 1);
......@@ -18,12 +19,21 @@ namespace limbo {
/**
@ingroup kernel
\rst
Matern 3/2 kernel (TODO: formula)
Matern 3/2 kernel
.. math::
d = ||v1 - v2||
\nu = 3/2
C(d) = \sigma^2\frac{2^{1-\nu}}{\Gamma(\nu)}\Bigg(\sqrt{2\nu}\frac{d}{l}\Bigg)^\nu K_\nu\Bigg(\sqrt{2\nu}\frac{d}{l}\Bigg),
Parameters:
- ``double sigma``
- ``double sigma`` **squared**
- ``double l``
Reference: :cite:`matern1960spatial` & :cite:`brochu2010tutorial` p.10 & https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function
\endrst
*/
template <typename Params>
......
......@@ -13,10 +13,11 @@ namespace limbo {
Computes the squared exponential covariance like this:
.. math::
k_{SE}(x, y) = \alpha^2 \exp(-\frac{1}{2}(x-y)^T\Lambda^{-1}(x-y)),
k_{SE}(x, y) = \alpha^2 \exp \Big(-\frac{1}{2}(x-y)^T\Lambda^{-1}(x-y)\Big),
with :math:`\Lambda = diag(l_1^2, \dots, l_n^2)` being the characteristic length scales and :math:`\alpha` describing the variability of the latent function. The parameters :math:`l_1^2, \dots, l_n^2, \alpha` are expected in this order in the parameter array.
Reference: :cite:`Rasmussen2006`, p. 106 & :cite:`brochu2010tutorial`, p. 10
\endrst
*/
template <typename Params>
......
......@@ -159,7 +159,7 @@ namespace limbo {
/** return the number of blacklisted samples used to compute the GP
\rst
For the blacklist concept, see :doc:`limbo_concepts`.
For the blacklist concept, see the Limbo-specific concept guide.
\endrst
*/
int nb_bl_samples() const { return _bl_samples.size(); }
......@@ -182,7 +182,7 @@ namespace limbo {
const Eigen::MatrixXd& alpha() const { return _alpha; }
/// return the list of samples that have been tested so far
/// return the list of samples that have been tested so far
const std::vector<Eigen::VectorXd>& samples() const { return _samples; }
protected:
......
......@@ -15,10 +15,12 @@ namespace limbo {
\rst
.. code-block:: cpp
template <typename BO>
void _create_log_file(const BO& bo, const std::string& name)
This method allocates an attribute `_log_file` (type: `std::shared_ptr<std::ofstream>`) if it has not been created yet, and does nothing otherwise. This method is designed so that you can safely call it in operator() while being 'guaranteed' that the file exists. Using this method is not mandatory for a statistics class.
\endrst
*/
template <typename Params>
......@@ -41,6 +43,7 @@ namespace limbo {
if (!_log_file && bo.stats_enabled()) {
std::string log = bo.res_dir() + "/" + name;
_log_file = std::make_shared<std::ofstream>(log.c_str());
assert(_log_file->godod());
}
}
};
......
......@@ -3,8 +3,19 @@
namespace limbo {
namespace stop {
///@ingroup stop
/// TODO
/**
\rst
Utility functor for boost::fusion::accumulate, e.g.:
.. code-block:: cpp
stop::ChainCriteria<BO, AggregatorFunction> chain(bo, afun);
return boost::fusion::accumulate(_stopping_criteria, false, chain);
Where ``_stopping_criteria` is a ``boost::fusion::vector`` of classes.
\endrst
*/
template <typename BO, typename AggregatorFunction>
struct ChainCriteria {
typedef bool result_type;
......
......@@ -5,13 +5,13 @@
namespace limbo {
namespace defaults {
///@ingroup stop_defaults
struct stop_maxiterations {
/// @ingroup stop_defaults
BO_PARAM(int, iterations, 190);
};
}
namespace stop {
///@ingroup stop
/// @ingroup stop
/// Stop after a given number of iterations
///
/// parameter: int iterations
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment