Beispiel #1
0
def test_probability_of_feasibility_builder_builds_pof(threshold: float,
                                                       at: tf.Tensor) -> None:
    builder = ProbabilityOfFeasibility(threshold)
    acq = builder.prepare_acquisition_function(zero_dataset(),
                                               QuadraticWithUnitVariance())
    expected = probability_of_feasibility(QuadraticWithUnitVariance(),
                                          threshold, at)
    npt.assert_allclose(acq(at), expected)
Beispiel #2
0
def test_probability_of_feasibility_builder_builds_pof(threshold: float,
                                                       at: tf.Tensor) -> None:
    builder = ProbabilityOfFeasibility(threshold)
    acq = builder.prepare_acquisition_function(empty_dataset([1], [1]),
                                               QuadraticMeanAndRBFKernel())
    expected = probability_of_feasibility(QuadraticMeanAndRBFKernel(),
                                          threshold, at)
    npt.assert_allclose(acq(at), expected)