mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-02 14:45:15 +02:00
Merge branch 'master' of github.com:SheffieldML/GPy
This commit is contained in:
commit
71c47cceee
10 changed files with 83 additions and 34 deletions
|
|
@ -9,3 +9,10 @@ import util
|
||||||
import examples
|
import examples
|
||||||
from core import priors
|
from core import priors
|
||||||
import likelihoods
|
import likelihoods
|
||||||
|
import testing
|
||||||
|
from numpy.testing import Tester
|
||||||
|
from nose.tools import nottest
|
||||||
|
|
||||||
|
@nottest
|
||||||
|
def tests():
|
||||||
|
Tester(testing).test(verbose=10)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ class BGPLVMTests(unittest.TestCase):
|
||||||
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
K = k.K(X)
|
K = k.K(X)
|
||||||
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
||||||
|
Y -= Y.mean(axis=0)
|
||||||
k = GPy.kern.bias(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.bias(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
||||||
m.constrain_positive('(rbf|bias|noise|white|S)')
|
m.constrain_positive('(rbf|bias|noise|white|S)')
|
||||||
|
|
@ -24,6 +25,7 @@ class BGPLVMTests(unittest.TestCase):
|
||||||
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
K = k.K(X)
|
K = k.K(X)
|
||||||
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
||||||
|
Y -= Y.mean(axis=0)
|
||||||
k = GPy.kern.linear(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.linear(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
||||||
m.constrain_positive('(linear|bias|noise|white|S)')
|
m.constrain_positive('(linear|bias|noise|white|S)')
|
||||||
|
|
@ -36,6 +38,7 @@ class BGPLVMTests(unittest.TestCase):
|
||||||
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
K = k.K(X)
|
K = k.K(X)
|
||||||
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
||||||
|
Y -= Y.mean(axis=0)
|
||||||
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
||||||
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
||||||
m.constrain_positive('(rbf|bias|noise|white|S)')
|
m.constrain_positive('(rbf|bias|noise|white|S)')
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ class KernelTests(unittest.TestCase):
|
||||||
X = np.random.rand(5,5)
|
X = np.random.rand(5,5)
|
||||||
Y = np.ones((5,1))
|
Y = np.ones((5,1))
|
||||||
m = GPy.models.GP_regression(X,Y,K)
|
m = GPy.models.GP_regression(X,Y,K)
|
||||||
print m
|
|
||||||
self.assertTrue(m.checkgrad())
|
self.assertTrue(m.checkgrad())
|
||||||
|
|
||||||
def test_coregionalisation(self):
|
def test_coregionalisation(self):
|
||||||
|
|
|
||||||
|
|
@ -192,17 +192,6 @@ class GradientTests(unittest.TestCase):
|
||||||
m.approximate_likelihood()
|
m.approximate_likelihood()
|
||||||
self.assertTrue(m.checkgrad())
|
self.assertTrue(m.checkgrad())
|
||||||
|
|
||||||
def test_warped_GP(self):
|
|
||||||
xmin, xmax = 1, 2.5*np.pi
|
|
||||||
b, C, SNR = 1, 0, 0.1
|
|
||||||
X = np.linspace(xmin, xmax, 500)
|
|
||||||
y = b*X + C + 1*np.sin(X)
|
|
||||||
y += 0.05*np.random.randn(len(X))
|
|
||||||
X, y = X[:, None], y[:, None]
|
|
||||||
m = GPy.models.warpedGP(X, y, warping_terms = 3)
|
|
||||||
m.constrain_positive('(tanh_a|tanh_b|rbf|white|bias)')
|
|
||||||
self.assertTrue(m.checkgrad())
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print "Running unit tests, please be (very) patient..."
|
print "Running unit tests, please be (very) patient..."
|
||||||
|
|
|
||||||
BIN
doc/Figures/tick.png
Normal file
BIN
doc/Figures/tick.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 175 B |
|
|
@ -73,6 +73,22 @@ examples Package
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
:mod:`tuto_GP_regression` Module
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.examples.tuto_GP_regression
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
:mod:`tuto_kernel_overview` Module
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.examples.tuto_kernel_overview
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`uncertain_input_GP_regression_demo` Module
|
:mod:`uncertain_input_GP_regression_demo` Module
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,14 @@ kern Package
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
:mod:`coregionalise` Module
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.coregionalise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`exponential` Module
|
:mod:`exponential` Module
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|
@ -113,18 +121,18 @@ kern Package
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`product` Module
|
:mod:`prod` Module
|
||||||
---------------------
|
------------------
|
||||||
|
|
||||||
.. automodule:: GPy.kern.product
|
.. automodule:: GPy.kern.prod
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`product_orthogonal` Module
|
:mod:`prod_orthogonal` Module
|
||||||
--------------------------------
|
-----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.kern.product_orthogonal
|
.. automodule:: GPy.kern.prod_orthogonal
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
@ -145,6 +153,14 @@ kern Package
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
:mod:`symmetric` Module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.symmetric
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sympykern` Module
|
:mod:`sympykern` Module
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,36 @@
|
||||||
List of implemented kernels
|
List of implemented kernels
|
||||||
***************************
|
***************************
|
||||||
|
|
||||||
The :math:`\checkmark` symbol represents the functions that have been implemented for each kernel.
|
The following table shows the implemented kernels in GPy and gives the details of the implemented function for each kernel.
|
||||||
|
|
||||||
.. |tick|
|
==================== =========== ====== ======= =========== =============== ======= =========== ====== ====== =======
|
||||||
|
|
||||||
.. |tick| image:: tick.png
|
|
||||||
|
|
||||||
|
|
||||||
====== =========== === ======= =========== =============== ======= =========== ====== ====== =======
|
|
||||||
NAME get/set K Kdiag dK_dtheta dKdiag_dtheta dK_dX dKdiag_dX psi0 psi1 psi2
|
NAME get/set K Kdiag dK_dtheta dKdiag_dtheta dK_dX dKdiag_dX psi0 psi1 psi2
|
||||||
====== =========== === ======= =========== =============== ======= =========== ====== ====== =======
|
==================== =========== ====== ======= =========== =============== ======= =========== ====== ====== =======
|
||||||
rbf \\checkmark y
|
bias |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
====== =========== === ======= =========== =============== ======= =========== ====== ====== =======
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
Brownian |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
exponential |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
finite_dimensional |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
linear |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
Matern32 |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
Matern52 |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
periodic_exponential |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
periodic_Matern32 |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
periodic_Matern52 |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
rbf |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
spline |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
-------------------- ----------- ------ ------- ----------- --------------- ------- ----------- ------ ------ -------
|
||||||
|
white |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick| |tick|
|
||||||
|
==================== =========== ====== ======= =========== =============== ======= =========== ====== ====== =======
|
||||||
|
|
||||||
|
.. |tick| image:: Figures/tick.png
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ return::
|
||||||
Implemented kernels
|
Implemented kernels
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Many kernels are already implemented in GPy. A comprehensive list can be found `here <kernel_implementation.html>`_ . The following figure gives a summary of most of them:
|
Many kernels are already implemented in GPy. A comprehensive list can be found `here <kernel_implementation.html>`_ and the following figure gives a summary of most of them:
|
||||||
|
|
||||||
.. figure:: Figures/tuto_kern_overview_allkern.png
|
.. figure:: Figures/tuto_kern_overview_allkern.png
|
||||||
:align: center
|
:align: center
|
||||||
|
|
|
||||||
6
setup.py
6
setup.py
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
#from numpy.distutils.core import Extension, setup
|
|
||||||
#from sphinx.setup_command import BuildDoc
|
|
||||||
|
|
||||||
# Version number
|
# Version number
|
||||||
version = '0.1.3'
|
version = '0.1.3'
|
||||||
|
|
@ -14,12 +12,12 @@ def read(fname):
|
||||||
|
|
||||||
setup(name = 'GPy',
|
setup(name = 'GPy',
|
||||||
version = version,
|
version = version,
|
||||||
author = 'James Hensman, Nicolo Fusi, Ricardo Andrade, Nicolas Durrande, Alan Saul, Neil D. Lawrence',
|
author = read('AUTHORS.txt'),
|
||||||
author_email = "james.hensman@gmail.com",
|
author_email = "james.hensman@gmail.com",
|
||||||
description = ("The Gaussian Process Toolbox"),
|
description = ("The Gaussian Process Toolbox"),
|
||||||
license = "BSD 3-clause",
|
license = "BSD 3-clause",
|
||||||
keywords = "machine-learning gaussian-processes kernels",
|
keywords = "machine-learning gaussian-processes kernels",
|
||||||
url = "http://ml.sheffield.ac.uk/GPy/",
|
url = "http://sheffieldml.github.com/GPy/",
|
||||||
packages = ['GPy', 'GPy.core', 'GPy.kern', 'GPy.util', 'GPy.models', 'GPy.inference', 'GPy.examples', 'GPy.likelihoods'],
|
packages = ['GPy', 'GPy.core', 'GPy.kern', 'GPy.util', 'GPy.models', 'GPy.inference', 'GPy.examples', 'GPy.likelihoods'],
|
||||||
package_dir={'GPy': 'GPy'},
|
package_dir={'GPy': 'GPy'},
|
||||||
package_data = {'GPy': ['GPy/examples']},
|
package_data = {'GPy': ['GPy/examples']},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue