def test_gaussian_kernel_theano_execute(): if not theano_available: raise SkipTest("Theano not available") D = 3 x = np.random.randn(D) y = np.random.randn(D) sigma = 2. gaussian_kernel_theano(x, y, sigma)
def test_gaussian_kernel_theano_execute(): if not theano_available: raise SkipTest("Theano not available") D = 3 x = np.random.randn(D) y = np.random.randn(D) sigma = 2. gaussian_kernel_theano(x, y, sigma)
def test_gaussian_kernel_theano_result_equals_manual(): if not theano_available: raise SkipTest("Theano not available") D = 3 x = np.random.randn(D) y = np.random.randn(D) sigma = 2. k = gaussian_kernel_theano(x, y, sigma) k_manual = gaussian_kernel(x[np.newaxis, :], y[np.newaxis, :], sigma)[0, 0] assert_almost_equal(k, k_manual)
def test_gaussian_kernel_theano_result_equals_manual(): if not theano_available: raise SkipTest("Theano not available") D = 3 x = np.random.randn(D) y = np.random.randn(D) sigma = 2. k = gaussian_kernel_theano(x, y, sigma) k_manual = gaussian_kernel(x[np.newaxis, :], y[np.newaxis, :], sigma)[0, 0] assert_almost_equal(k, k_manual)