mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-03 16:52:39 +02:00
added unit test for param tie at the kernel level
This commit is contained in:
parent
5f63ad5524
commit
894412a177
1 changed files with 23 additions and 0 deletions
23
GPy/testing/kernel_tests.py
Normal file
23
GPy/testing/kernel_tests.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
|
||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||
|
||||
import unittest
|
||||
import numpy as np
|
||||
import GPy
|
||||
|
||||
class KernelTests(unittest.TestCase):
|
||||
def test_kerneltie(self):
|
||||
K = GPy.kern.rbf(5, ARD=True)
|
||||
K.tie_param('[01]')
|
||||
K.constrain_fixed('2')
|
||||
X = np.random.rand(5,5)
|
||||
Y = np.ones((5,1))
|
||||
m = GPy.models.GP_regression(X,Y,K)
|
||||
print m
|
||||
self.assertTrue(m.checkgrad())
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print "Running unit tests, please be (very) patient..."
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue