mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 11:32:39 +02:00
Update rv_transformation_tests.py
This commit is contained in:
parent
bba003eb85
commit
92c703ba12
1 changed files with 3 additions and 3 deletions
|
|
@ -30,8 +30,7 @@ class RVTransformationTestCase(unittest.TestCase):
|
||||||
m.theta.set_prior(prior)
|
m.theta.set_prior(prior)
|
||||||
m.theta.unconstrain()
|
m.theta.unconstrain()
|
||||||
m.theta.constrain(trans)
|
m.theta.constrain(trans)
|
||||||
np.random.seed(1234)
|
theta_s = prior.rvs(1e6)
|
||||||
theta_s = prior.rvs(5e5)
|
|
||||||
if kde:
|
if kde:
|
||||||
# The PDF of the transformed variables
|
# The PDF of the transformed variables
|
||||||
p_phi = lambda phi : np.exp(-m._objective_grads(phi)[0])
|
p_phi = lambda phi : np.exp(-m._objective_grads(phi)[0])
|
||||||
|
|
@ -58,7 +57,8 @@ class RVTransformationTestCase(unittest.TestCase):
|
||||||
# END OF PLOT
|
# END OF PLOT
|
||||||
# Check the gradients at a few random points
|
# Check the gradients at a few random points
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
m.theta = i+1.
|
m.theta = theta_s[i]
|
||||||
|
m.unset_prior()
|
||||||
self.assertTrue(m.checkgrad(verbose=True))
|
self.assertTrue(m.checkgrad(verbose=True))
|
||||||
|
|
||||||
def test_Logexp(self):
|
def test_Logexp(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue