Commit aedc90e1 authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Fix typos in kernels

parent 614026e7
......@@ -17,7 +17,7 @@ struct Params {
};
#endif
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
......
#include <limbo/tools/macros.hpp>
#include <limbo/kernel/matern_five_halfs.hpp>
#include <limbo/kernel/matern_five_halves.hpp>
#include <limbo/mean/data.hpp>
#include <limbo/model/gp.hpp>
#include <limbo/acqui/gp_ucb.hpp>
......@@ -27,7 +27,7 @@ BO_PARAMS(std::cout,
BO_PARAM(double, alpha, 0.1);
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
......
#include <limbo/tools/macros.hpp>
#include <limbo/kernel/matern_five_halfs.hpp>
#include <limbo/kernel/matern_five_halves.hpp>
#include <limbo/mean/data.hpp>
#include <limbo/model/gp.hpp>
#include <limbo/acqui/gp_ucb.hpp>
......@@ -21,7 +21,7 @@ struct Params {
struct opt_gridsearch : public defaults::opt_gridsearch {
};
#endif
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
......
......@@ -24,7 +24,7 @@ struct Params {
struct kernel_squared_exp_ard : public defaults::kernel_squared_exp_ard {
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
......
......@@ -5,8 +5,8 @@
///@defgroup kernel_defaults
#include <limbo/kernel/exp.hpp>
#include <limbo/kernel/matern_five_halfs.hpp>
#include <limbo/kernel/matern_three_halfs.hpp>
#include <limbo/kernel/matern_five_halves.hpp>
#include <limbo/kernel/matern_three_halves.hpp>
#include <limbo/kernel/squared_exp_ard.hpp>
#endif
#ifndef LIMBO_KERNEL_MATERN_FIVE_HALFS_HPP
#define LIMBO_KERNEL_MATERN_FIVE_HALFS_HPP
#ifndef LIMBO_KERNEL_MATERN_FIVE_HALVES_HPP
#define LIMBO_KERNEL_MATERN_FIVE_HALVES_HPP
#include <Eigen/Core>
......@@ -7,7 +7,7 @@
namespace limbo {
namespace defaults {
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
/// @ingroup kernel_defaults
BO_PARAM(double, sigma_sq, 1);
/// @ingroup kernel_defaults
......@@ -44,7 +44,7 @@ namespace limbo {
double operator()(const Eigen::VectorXd& v1, const Eigen::VectorXd& v2) const
{
double d = (v1 - v2).norm();
return Params::kernel_maternfivehalfs::sigma_sq() * (1 + std::sqrt(5) * d / Params::kernel_maternfivehalfs::l() + 5 * d * d / (3 * Params::kernel_maternfivehalfs::l() * Params::kernel_maternfivehalfs::l())) * std::exp(-std::sqrt(5) * d / Params::kernel_maternfivehalfs::l());
return Params::kernel_maternfivehalves::sigma_sq() * (1 + std::sqrt(5) * d / Params::kernel_maternfivehalves::l() + 5 * d * d / (3 * Params::kernel_maternfivehalves::l() * Params::kernel_maternfivehalves::l())) * std::exp(-std::sqrt(5) * d / Params::kernel_maternfivehalves::l());
}
};
}
......
#ifndef LIMBO_KERNEL_MATERN_THREE_HALFS_HPP
#define LIMBO_KERNEL_MATERN_THREE_HALFS_HPP
#ifndef LIMBO_KERNEL_MATERN_THREE_HALVES_HPP
#define LIMBO_KERNEL_MATERN_THREE_HALVES_HPP
#include <Eigen/Core>
......@@ -7,7 +7,7 @@
namespace limbo {
namespace defaults {
struct kernel_maternthreehalfs {
struct kernel_maternthreehalves {
/// @ingroup kernel_defaults
/// This is is sigma squared!
BO_PARAM(double, sigma_sq, 1);
......@@ -43,7 +43,7 @@ namespace limbo {
double operator()(const Eigen::VectorXd& v1, const Eigen::VectorXd& v2) const
{
double d = (v1 - v2).norm();
return Params::kernel_maternthreehalfs::sigma_sq() * (1 + std::sqrt(3) * d / Params::kernel_maternthreehalfs::l()) * std::exp(-std::sqrt(3) * d / Params::kernel_maternthreehalfs::l());
return Params::kernel_maternthreehalves::sigma_sq() * (1 + std::sqrt(3) * d / Params::kernel_maternthreehalves::l()) * std::exp(-std::sqrt(3) * d / Params::kernel_maternthreehalves::l());
}
};
}
......
......@@ -13,12 +13,12 @@ struct Params {
BO_PARAM(double, l, 1);
};
struct kernel_maternthreehalfs {
struct kernel_maternthreehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.2);
};
......
......@@ -4,8 +4,8 @@
#include <boost/test/unit_test.hpp>
#include <limbo/acqui/ucb.hpp>
#include <limbo/kernel/matern_five_halfs.hpp>
#include <limbo/kernel/matern_three_halfs.hpp>
#include <limbo/kernel/matern_five_halves.hpp>
#include <limbo/kernel/matern_three_halves.hpp>
#include <limbo/kernel/exp.hpp>
#include <limbo/kernel/squared_exp_ard.hpp>
#include <limbo/mean/constant.hpp>
......@@ -32,7 +32,7 @@ struct Params {
struct kernel_squared_exp_ard : public defaults::kernel_squared_exp_ard {
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 1);
BO_PARAM(double, l, 0.25);
};
......@@ -290,11 +290,11 @@ BOOST_AUTO_TEST_CASE(test_gp_init_variance)
BO_PARAM(double, sigma_sq, 10);
BO_PARAM(double, l, 1);
};
struct kernel_maternthreehalfs {
struct kernel_maternthreehalves {
BO_PARAM(double, sigma_sq, 10);
BO_PARAM(double, l, 0.25);
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma_sq, 10);
BO_PARAM(double, l, 0.25);
};
......
......@@ -26,7 +26,7 @@ struct Params {
struct kernel_exp : public defaults::kernel_exp {
};
struct kernel_maternfivehalfs {
struct kernel_maternfivehalves {
BO_PARAM(double, sigma, 1);
BO_PARAM(double, l, 0.25);
};
......
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