def test_k_multiple_equals_k_no_dim(self):
     N = 10
     X = np.random.randn(N,1)
     me = GaussianQuadraticTest(self.grad_log_normal)
     K1 = me.k_multiple_dim(X)
     K2  =me.k_multiple(X[:,0])
     np.testing.assert_almost_equal(K1, K2)
 def test_k_multiple_equals_k_no_dim(self):
     N = 10
     X = np.random.randn(N, 1)
     me = GaussianQuadraticTest(self.grad_log_normal)
     K1 = me.k_multiple_dim(X)
     K2 = me.k_multiple(X[:, 0])
     np.testing.assert_almost_equal(K1, K2)
 def test_k_multiple_equals_k_no_grad_multiple_given(self):
     N = 10
     X = np.random.randn(N)
     me = GaussianQuadraticTest(self.grad_log_normal)
     K = me.k_multiple(X)
     
     for i in range(N):
         for j in range(N):
             k = me.k(X[i], X[j])
             assert_almost_equal(K[i, j], k)
    def test_k_multiple_equals_k_no_grad_multiple_given(self):
        N = 10
        X = np.random.randn(N)
        me = GaussianQuadraticTest(self.grad_log_normal)
        K = me.k_multiple(X)

        for i in range(N):
            for j in range(N):
                k = me.k(X[i], X[j])
                assert_almost_equal(K[i, j], k)
 def test_k_multiple_equals_k_grad_multiple_given(self):
     def fun(self, X):
         return -X
     
     N = 10
     X = np.random.randn(N)
     me = GaussianQuadraticTest(self.grad_log_normal, grad_log_prob_multiple=fun)
     K = me.k_multiple(X)
     
     for i in range(N):
         for j in range(N):
             k = me.k(X[i], X[j])
             assert_almost_equal(K[i, j], k)
    def test_k_multiple_equals_k_grad_multiple_given(self):
        def fun(self, X):
            return -X

        N = 10
        X = np.random.randn(N)
        me = GaussianQuadraticTest(self.grad_log_normal,
                                   grad_log_prob_multiple=fun)
        K = me.k_multiple(X)

        for i in range(N):
            for j in range(N):
                k = me.k(X[i], X[j])
                assert_almost_equal(K[i, j], k)