forked from mblum/libgp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
56 changed files
with
932 additions
and
3,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# libgp - Gaussian process library for Machine Learning | ||
# Copyright (c) 2013, Manuel Blum <[email protected]> | ||
# All rights reserved. | ||
|
||
ADD_EXECUTABLE(gpdense gp_example_dense.cc) | ||
TARGET_LINK_LIBRARIES(gpdense gp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#include "gp.h" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* cg.h | ||
* | ||
* Created on: Feb 22, 2013 | ||
* Author: Joao Cunha <[email protected]> | ||
*/ | ||
|
||
#ifndef CG_H_ | ||
#define CG_H_ | ||
|
||
#include "gp.h" | ||
|
||
namespace libgp | ||
{ | ||
|
||
class CG | ||
{ | ||
public: | ||
CG(); | ||
virtual ~CG(); | ||
void maximize(GaussianProcess* gp, size_t n=100, bool verbose=1); | ||
}; | ||
|
||
} | ||
|
||
#endif /* CG_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_H__ | ||
|
@@ -13,94 +13,93 @@ | |
namespace libgp | ||
{ | ||
|
||
/** Covariance function base class. | ||
* @author Manuel Blum | ||
* @ingroup cov_group | ||
* @todo implement more covariance functions */ | ||
class CovarianceFunction | ||
{ | ||
public: | ||
/** Constructor. */ | ||
CovarianceFunction() {}; | ||
|
||
/** Destructor. */ | ||
virtual ~CovarianceFunction() {}; | ||
|
||
/** Initialization method for atomic covariance functions. | ||
* @param input_dim dimensionality of the input vectors */ | ||
virtual bool init(int input_dim) | ||
{ | ||
return false; | ||
}; | ||
/** Covariance function base class. | ||
* @author Manuel Blum | ||
* @ingroup cov_group | ||
* @todo implement more covariance functions */ | ||
class CovarianceFunction | ||
{ | ||
public: | ||
/** Constructor. */ | ||
CovarianceFunction() {}; | ||
|
||
/** Destructor. */ | ||
virtual ~CovarianceFunction() {}; | ||
|
||
/** Initialization method for atomic covariance functions. | ||
* @param input_dim dimensionality of the input vectors */ | ||
virtual bool init(int input_dim) | ||
{ | ||
return false; | ||
}; | ||
|
||
/** Initialization method for compound covariance functions. | ||
* @param input_dim dimensionality of the input vectors | ||
* @param first first covariance function of compound | ||
* @param second second covariance function of compound */ | ||
virtual bool init(int input_dim, CovarianceFunction * first, CovarianceFunction * second) | ||
{ | ||
return false; | ||
}; | ||
|
||
virtual bool init(int input_dim, int filter, CovarianceFunction * covf) | ||
{ | ||
return false; | ||
}; | ||
|
||
/** Computes the covariance of two input vectors. | ||
* @param x1 first input vector | ||
* @param x2 second input vector | ||
* @return covariance of x1 and x2 */ | ||
virtual double get(const Eigen::VectorXd &x1, const Eigen::VectorXd &x2) = 0; | ||
|
||
/** Covariance gradient of two input vectors with respect to the hyperparameters. | ||
* @param x1 first input vector | ||
* @param x2 second input vector | ||
* @param grad covariance gradient */ | ||
virtual void grad(const Eigen::VectorXd &x1, const Eigen::VectorXd &x2, Eigen::VectorXd &grad) = 0; | ||
|
||
/** Update parameter vector. | ||
* @param p new parameter vector */ | ||
virtual void set_loghyper(const Eigen::VectorXd &p); | ||
|
||
/** Update parameter vector. | ||
* @param p new parameter vector */ | ||
virtual void set_loghyper(const double p[]); | ||
|
||
/** Get number of parameters for this covariance function. | ||
* @return parameter vector dimensionality */ | ||
size_t get_param_dim(); | ||
|
||
/** Get input dimensionality. | ||
* @return input dimensionality */ | ||
size_t get_input_dim(); | ||
|
||
/** Get log-hyperparameter of covariance function. | ||
* @return log-hyperparameter */ | ||
Eigen::VectorXd get_loghyper(); | ||
|
||
/** Returns a string representation of this covariance function. | ||
* @return string containing the name of this covariance function */ | ||
virtual std::string to_string() = 0; | ||
|
||
/** Draw random target values from this covariance function for input X. */ | ||
Eigen::VectorXd draw_random_sample(Eigen::MatrixXd &X); | ||
|
||
bool loghyper_changed; | ||
|
||
protected: | ||
/** Input dimensionality. */ | ||
size_t input_dim; | ||
|
||
/** Size of parameter vector. */ | ||
size_t param_dim; | ||
|
||
/** Parameter vector containing the log hyperparameters of the covariance function. | ||
* The number of necessary parameters is given in param_dim. */ | ||
Eigen::VectorXd loghyper; | ||
|
||
/** Initialization method for compound covariance functions. | ||
* @param input_dim dimensionality of the input vectors | ||
* @param first first covariance function of compound | ||
* @param second second covariance function of compound */ | ||
virtual bool init(int input_dim, CovarianceFunction * first, CovarianceFunction * second) | ||
{ | ||
return false; | ||
}; | ||
|
||
/** Computes the covariance of two input vectors. | ||
* @param x1 first input vector | ||
* @param x2 second input vector | ||
* @return covariance of x1 and x2 */ | ||
virtual double get(const Eigen::VectorXd &x1, const Eigen::VectorXd &x2) = 0; | ||
|
||
/** Covariance gradient of two input vectors with respect to the hyperparameters. | ||
* @param x1 first input vector | ||
* @param x2 second input vector | ||
* @param grad covariance gradient */ | ||
virtual void grad(const Eigen::VectorXd &x1, const Eigen::VectorXd &x2, Eigen::VectorXd &grad) = 0; | ||
|
||
/** Update parameter vector. | ||
* @param p new parameter vector */ | ||
virtual void set_loghyper(const Eigen::VectorXd &p); | ||
|
||
/** Update parameter vector. | ||
* @param p new parameter vector */ | ||
virtual void set_loghyper(const double p[]); | ||
|
||
/** Get number of parameters for this covariance function. | ||
* @return parameter vector dimensionality */ | ||
size_t get_param_dim(); | ||
|
||
/** Get input dimensionality. | ||
* @return input dimensionality */ | ||
size_t get_input_dim(); | ||
|
||
/** Get log-hyperparameter of covariance function. | ||
* @return log-hyperparameter */ | ||
Eigen::VectorXd get_loghyper(); | ||
|
||
/** Returns a string representation of this covariance function. | ||
* @return string containing the name of this covariance function */ | ||
virtual std::string to_string() = 0; | ||
|
||
/** Draw random target values from this covariance function for input X. */ | ||
Eigen::VectorXd draw_random_sample(Eigen::MatrixXd &X); | ||
|
||
/** Get distance threshold of this covariance function. */ | ||
virtual double get_threshold(); | ||
|
||
/** Set distance threshold of this covariance function. */ | ||
virtual void set_threshold(double threshold); | ||
|
||
bool loghyper_changed; | ||
|
||
protected: | ||
/** Input dimensionality. */ | ||
size_t input_dim; | ||
|
||
/** Size of parameter vector. */ | ||
size_t param_dim; | ||
|
||
/** Parameter vector containing the log hyperparameters of the covariance function. | ||
* The number of necessary parameters is given in param_dim. */ | ||
Eigen::VectorXd loghyper; | ||
|
||
}; | ||
}; | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_FACTORY_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_LINEAR_ARD_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_LINEAR_ONE__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_MATERN3_ISO_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_MATERN5_ISO_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// libgp - Gaussian process library for Machine Learning | ||
// Copyright (c) 2011, Manuel Blum <[email protected]> | ||
// Copyright (c) 2013, Manuel Blum <[email protected]> | ||
// All rights reserved. | ||
|
||
#ifndef __COV_NOISE_H__ | ||
|
Oops, something went wrong.