mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-30 23:36:23 +02:00
migrate fitc to pytest
This commit is contained in:
parent
ba1c5d8b49
commit
59657bc49d
1 changed files with 6 additions and 5 deletions
|
|
@ -1,13 +1,12 @@
|
||||||
# Copyright (c) 2014, James Hensman
|
# Copyright (c) 2014, James Hensman
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
import unittest
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import GPy
|
import GPy
|
||||||
|
|
||||||
|
|
||||||
class FITCtest(unittest.TestCase):
|
class FITCtest:
|
||||||
def setUp(self):
|
def setup(self):
|
||||||
######################################
|
######################################
|
||||||
# # 1 dimensional example
|
# # 1 dimensional example
|
||||||
|
|
||||||
|
|
@ -27,11 +26,13 @@ class FITCtest(unittest.TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_fitc_1d(self):
|
def test_fitc_1d(self):
|
||||||
|
self.setup()
|
||||||
m = GPy.models.SparseGPRegression(self.X1D, self.Y1D)
|
m = GPy.models.SparseGPRegression(self.X1D, self.Y1D)
|
||||||
m.inference_method = GPy.inference.latent_function_inference.FITC()
|
m.inference_method = GPy.inference.latent_function_inference.FITC()
|
||||||
self.assertTrue(m.checkgrad())
|
assert m.checkgrad(), "Gradient check failed!"
|
||||||
|
|
||||||
def test_fitc_2d(self):
|
def test_fitc_2d(self):
|
||||||
|
self.setup()
|
||||||
m = GPy.models.SparseGPRegression(self.X2D, self.Y2D)
|
m = GPy.models.SparseGPRegression(self.X2D, self.Y2D)
|
||||||
m.inference_method = GPy.inference.latent_function_inference.FITC()
|
m.inference_method = GPy.inference.latent_function_inference.FITC()
|
||||||
self.assertTrue(m.checkgrad())
|
assert m.checkgrad(), "Gradient check failed!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue