Skip to content

Commit

Permalink
Fix slow tests (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
uri-granta authored Mar 25, 2024
1 parent 0a25516 commit 21173e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 0 additions & 5 deletions tests/integration/test_bayesian_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ def test_bayesian_optimizer_with_dgp_finds_minima_of_simple_quadratic(

@random_seed
@pytest.mark.slow
@pytest.mark.parametrize(
"dtype", [pytest.param(tf.float64, id="float64"), pytest.param(tf.float32, id="float32")]
)
@pytest.mark.parametrize(
"num_steps, acquisition_rule",
[
Expand All @@ -517,7 +514,6 @@ def test_bayesian_optimizer_with_dgp_finds_minima_of_simple_quadratic(
],
)
def test_bayesian_optimizer_with_deep_ensemble_finds_minima_of_scaled_branin(
dtype: tf.DType,
num_steps: int,
acquisition_rule: Callable[[], AcquisitionRule[TensorType, SearchSpace, DeepEnsemble]],
) -> None:
Expand All @@ -527,7 +523,6 @@ def test_bayesian_optimizer_with_deep_ensemble_finds_minima_of_scaled_branin(
acquisition_rule(),
optimize_branin=True,
model_args={"bootstrap": True, "diversify": False},
single_precision=dtype == tf.float32,
)


Expand Down
5 changes: 4 additions & 1 deletion trieste/models/gpflow/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
from ...types import TensorType
from ..gpflow.models import GaussianProcessRegression

KERNEL_LENGTHSCALE = tf.constant(0.2, dtype=gpflow.default_float())
# NOTE: As a static non-Tensor, this should really be a tf.constant (like the other constants).
# However, changing it breaks serialisation during the expected_improvement.pct.py notebook.
# See https://github.com/secondmind-labs/trieste/issues/833 for details.
KERNEL_LENGTHSCALE = tf.cast(0.2, dtype=gpflow.default_float())
"""
Default value of the kernel lengthscale parameter.
"""
Expand Down

0 comments on commit 21173e4

Please sign in to comment.