diff --git a/botorch/test_functions/multi_objective.py b/botorch/test_functions/multi_objective.py index e76bf78907..c363f3dbae 100644 --- a/botorch/test_functions/multi_objective.py +++ b/botorch/test_functions/multi_objective.py @@ -772,7 +772,7 @@ def penicillin_vectorized(cls, X_input: Tensor) -> Tensor: F_loss = ( V[active] * cls.lambd - * (torch.exp(5 * ((T[active] - cls.T_o) / (cls.T_v - cls.T_o))) - 1) + * torch.special.expm1(5 * ((T[active] - cls.T_o) / (cls.T_v - cls.T_o))) ) dV_dt = F[active] - F_loss mu = ( diff --git a/test/models/transforms/test_utils.py b/test/models/transforms/test_utils.py index a6a41e05e5..da1102f1e1 100644 --- a/test/models/transforms/test_utils.py +++ b/test/models/transforms/test_utils.py @@ -86,7 +86,7 @@ def test_norm_to_lognorm(self): mu_ln_expected = torch.tensor( [1.0, 2.0, 3.0], device=self.device, dtype=dtype ) - var_ln_expected = (torch.exp(var) - 1) * mu_ln_expected**2 + var_ln_expected = torch.special.expm1(var) * mu_ln_expected**2 self.assertAllClose(mu_ln, mu_ln_expected) self.assertAllClose(var_ln, var_ln_expected)