mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-07 19:12:40 +02:00
Update rv_transformation_tests.py
This commit is contained in:
parent
30c91be886
commit
4a300a7c9d
1 changed files with 2 additions and 2 deletions
|
|
@ -30,7 +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)
|
||||||
theta_s = prior.rvs(1e6)
|
theta_s = prior.rvs(1e5)
|
||||||
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])
|
||||||
|
|
@ -56,7 +56,7 @@ class RVTransformationTestCase(unittest.TestCase):
|
||||||
#plt.show(block=True)
|
#plt.show(block=True)
|
||||||
# END OF PLOT
|
# END OF PLOT
|
||||||
# Check the gradients at a few random points
|
# Check the gradients at a few random points
|
||||||
#np.random.seed(12345)
|
np.random.seed(500)
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
m.theta = theta_s[i]
|
m.theta = theta_s[i]
|
||||||
self.assertTrue(m.checkgrad(verbose=True))
|
self.assertTrue(m.checkgrad(verbose=True))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue