mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
[testing]
This commit is contained in:
parent
a56f56e9fa
commit
a39a63c7f8
2 changed files with 8 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ def plot_latent(model, labels=None, which_indices=None,
|
||||||
Xtest_full[:, [input_1, input_2]] = x
|
Xtest_full[:, [input_1, input_2]] = x
|
||||||
_, var = model.predict(Xtest_full, **predict_kwargs)
|
_, var = model.predict(Xtest_full, **predict_kwargs)
|
||||||
var = var[:, :1]
|
var = var[:, :1]
|
||||||
return 2*np.sqrt(var)
|
return np.log(var)
|
||||||
|
|
||||||
#Create an IMshow controller that can re-plot the latent space shading at a good resolution
|
#Create an IMshow controller that can re-plot the latent space shading at a good resolution
|
||||||
if plot_limits is None:
|
if plot_limits is None:
|
||||||
|
|
@ -304,7 +304,7 @@ def plot_magnification(model, labels=None, which_indices=None,
|
||||||
view = ImshowController(ax, plot_function,
|
view = ImshowController(ax, plot_function,
|
||||||
(xmin, ymin, xmax, ymax),
|
(xmin, ymin, xmax, ymax),
|
||||||
resolution, aspect=aspect, interpolation='bilinear',
|
resolution, aspect=aspect, interpolation='bilinear',
|
||||||
cmap=cm.gray)
|
cmap=cm.get_cmap('Greys'))
|
||||||
|
|
||||||
# make sure labels are in order of input:
|
# make sure labels are in order of input:
|
||||||
ulabels = []
|
ulabels = []
|
||||||
|
|
|
||||||
|
|
@ -248,10 +248,16 @@ class ParameterizedTest(unittest.TestCase):
|
||||||
m.randomize()
|
m.randomize()
|
||||||
self.assertEqual(m.p1, val)
|
self.assertEqual(m.p1, val)
|
||||||
|
|
||||||
|
def test_checkgrad(self):
|
||||||
|
assert(self.testmodel.kern.checkgrad())
|
||||||
|
assert(self.testmodel.kern.lengthscale.checkgrad())
|
||||||
|
assert(self.testmodel.likelihood.lengthscale.checkgrad())
|
||||||
|
|
||||||
def test_printing(self):
|
def test_printing(self):
|
||||||
print(self.test1)
|
print(self.test1)
|
||||||
print(self.param)
|
print(self.param)
|
||||||
print(self.test1[''])
|
print(self.test1[''])
|
||||||
|
print(self.testmodel.hierarchy_name(False))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#import sys;sys.argv = ['', 'Test.test_add_parameter']
|
#import sys;sys.argv = ['', 'Test.test_add_parameter']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue