Skip to content

Commit

Permalink
Removes test of manual CDF
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgondu committed Jul 3, 2024
1 parent b651e90 commit ceef630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def test_utility_functions_have_correct_shapes(
posterior = generate_dummy_conjugate_posterior(dataset)
posteriors = {OBJECTIVE: posterior}
datasets = {OBJECTIVE: dataset}
ts_utility_builder = utility_function_builder(**utility_function_kwargs)
ts_utility_function = ts_utility_builder.build_utility_function(
utility_builder = utility_function_builder(**utility_function_kwargs)
utility_function = utility_builder.build_utility_function(
posteriors=posteriors, datasets=datasets, key=key
)
test_key, _ = jr.split(key)
test_X = test_target_function.generate_test_points(num_test_points, test_key)
ts_utility_function_values = ts_utility_function(test_X)
ts_utility_function_values = utility_function(test_X)
assert ts_utility_function_values.shape == (num_test_points, 1)
7 changes: 0 additions & 7 deletions tests/test_decision_making/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from gpjax.decision_making.utils import (
OBJECTIVE,
build_function_evaluator,
gaussian_cdf,
)
from gpjax.typing import (
Array,
Expand All @@ -45,9 +44,3 @@ def _cube(x: Float[Array, "N 1"]) -> Float[Array, "N 1"]:
assert jnp.equal(datasets[OBJECTIVE].y, _square(x)).all()
assert jnp.equal(datasets["CONSTRAINT"].X, x).all()
assert jnp.equal(datasets["CONSTRAINT"].y, _cube(x)).all()


def test_gaussian_cdf():
x = jnp.array([0.0, 1.0, 2.0])
cdf = jnp.array([0.5, 0.84134475, 0.97724987])
assert jnp.allclose(cdf, gaussian_cdf(x))

0 comments on commit ceef630

Please sign in to comment.