mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-18 13:55:14 +02:00
fix: model tests numpy integer error
This commit is contained in:
parent
b8aabb97f8
commit
970bd5399b
1 changed files with 10 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
|
||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||
|
||||
from __future__ import division
|
||||
|
||||
import unittest
|
||||
import numpy as np
|
||||
|
|
@ -759,16 +759,18 @@ class GradientTests(np.testing.TestCase):
|
|||
|
||||
def test_GP_EP_probit(self):
|
||||
N = 20
|
||||
X = np.hstack([np.random.normal(5, 2, N / 2), np.random.normal(10, 2, N / 2)])[:, None]
|
||||
Y = np.hstack([np.ones(N / 2), np.zeros(N / 2)])[:, None]
|
||||
Nhalf = int(N/2)
|
||||
X = np.hstack([np.random.normal(5, 2, Nhalf), np.random.normal(10, 2, Nhalf)])[:, None]
|
||||
Y = np.hstack([np.ones(Nhalf), np.zeros(Nhalf)])[:, None]
|
||||
kernel = GPy.kern.RBF(1)
|
||||
m = GPy.models.GPClassification(X, Y, kernel=kernel)
|
||||
self.assertTrue(m.checkgrad())
|
||||
|
||||
def test_sparse_EP_DTC_probit(self):
|
||||
N = 20
|
||||
X = np.hstack([np.random.normal(5, 2, N / 2), np.random.normal(10, 2, N / 2)])[:, None]
|
||||
Y = np.hstack([np.ones(N / 2), np.zeros(N / 2)])[:, None]
|
||||
Nhalf = int(N/2)
|
||||
X = np.hstack([np.random.normal(5, 2, Nhalf), np.random.normal(10, 2, Nhalf)])[:, None]
|
||||
Y = np.hstack([np.ones(Nhalf), np.zeros(Nhalf)])[:, None]
|
||||
Z = np.linspace(0, 15, 4)[:, None]
|
||||
kernel = GPy.kern.RBF(1)
|
||||
m = GPy.models.SparseGPClassification(X, Y, kernel=kernel, Z=Z)
|
||||
|
|
@ -776,8 +778,9 @@ class GradientTests(np.testing.TestCase):
|
|||
|
||||
def test_sparse_EP_DTC_probit_uncertain_inputs(self):
|
||||
N = 20
|
||||
X = np.hstack([np.random.normal(5, 2, N / 2), np.random.normal(10, 2, N / 2)])[:, None]
|
||||
Y = np.hstack([np.ones(N / 2), np.zeros(N / 2)])[:, None]
|
||||
Nhalf = int(N/2)
|
||||
X = np.hstack([np.random.normal(5, 2, Nhalf), np.random.normal(10, 2, Nhalf)])[:, None]
|
||||
Y = np.hstack([np.ones(Nhalf), np.zeros(Nhalf)])[:, None]
|
||||
Z = np.linspace(0, 15, 4)[:, None]
|
||||
X_var = np.random.uniform(0.1, 0.2, X.shape)
|
||||
kernel = GPy.kern.RBF(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue