mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-11 15:15:15 +02:00
Update rv_transformation_tests.py
This commit is contained in:
parent
51a744aa45
commit
122e6781c1
1 changed files with 4 additions and 3 deletions
|
|
@ -56,13 +56,14 @@ class RVTransformationTestCase(unittest.TestCase):
|
|||
# The following test cannot be very accurate
|
||||
self.assertTrue(np.linalg.norm(pdf_phi - kde(phi)) / np.linalg.norm(kde(phi)) <= 1e-1)
|
||||
# Check the gradients at a few random points
|
||||
checks_failes = 0.
|
||||
checks_failed = 0.
|
||||
checks = 40
|
||||
for i in range(checks):
|
||||
m.theta = theta_s[i]
|
||||
print(m.theta, m.optimizer_array, m.param_array)
|
||||
if not m.checkgrad(1):
|
||||
checks_failes += 1.
|
||||
if not m.checkgrad():
|
||||
checks_failed += 1.
|
||||
m.checkgrad(1)
|
||||
self.assertTrue(checks_failed/float(checks) > .7)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue