def test_gaussian_kernel_hessian_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_hessian_theano(x, y, sigma)
def test_gaussian_kernel_hessian_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_hessian_theano(x, y, sigma)
def hessian(self, x): """ Computes the Hessian of the learned log-density function. WARNING: This implementation slow, so don't call repeatedly. """ assert_array_shape(x, ndim=1, dims={0: self.D}) H = np.zeros((self.D, self.D)) for i, a in enumerate(self.alpha): H += a * gaussian_kernel_hessian_theano(x, self.X[i], self.sigma) return H
def hessian(self, x): """ Computes the Hessian of the learned log-density function. WARNING: This implementation slow, so don't call repeatedly. """ assert_array_shape(x, ndim=1, dims={0: self.D}) H = np.zeros((self.D, self.D)) for i, a in enumerate(self.alpha): H += a * gaussian_kernel_hessian_theano(x, self.X[i], self.sigma) return H