Skip to content

Commit

Permalink
fix seed
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Aug 30, 2023
1 parent 7bf2a6f commit f9d3126
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def model(x_y, mux, muy, sx, sy, rho):
assert m.ngrad > 0

ref = numerical_cost_gradient(cost)
assert_allclose(cost.grad(*m.values), ref(*m.values), atol=0.2)
assert_allclose(cost.grad(*m.values), ref(*m.values), rtol=0.01)
else:
assert m.ngrad == 0

Expand Down Expand Up @@ -406,7 +406,7 @@ def model(x_y, n, mux, muy, sx, sy, rho):
return n, n * mvnorm(mux, muy, sx, sy, rho).pdf(x_y.T)

truth = 100.0, 0.1, 0.2, 0.3, 0.4, 0.5
x, y = mvnorm(*truth[1:]).rvs(size=int(truth[0])).T
x, y = mvnorm(*truth[1:]).rvs(size=int(truth[0]), random_state=1).T

cost = ExtendedUnbinnedNLL(
(x, y), model, grad=numerical_extended_model_gradient(model)
Expand All @@ -424,7 +424,7 @@ def model(x_y, n, mux, muy, sx, sy, rho):
assert m.ngrad > 0

ref = numerical_cost_gradient(cost)
assert_allclose(cost.grad(*m.values), ref(*m.values), atol=0.5)
assert_allclose(cost.grad(*m.values), ref(*m.values), rtol=0.01)
else:
assert m.ngrad == 0

Expand Down

0 comments on commit f9d3126

Please sign in to comment.