diff --git a/test/algorithms/test_auer.py b/test/algorithms/test_auer.py index 785098c..879f551 100644 --- a/test/algorithms/test_auer.py +++ b/test/algorithms/test_auer.py @@ -23,7 +23,7 @@ def setUp(self): self.order = ComponentwiseOrder(2) self.noise_var = 0.00001 self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality - self.conf_contraction = 4 + self.conf_contraction = 32 self.algorithm = Auer( epsilon=self.epsilon, delta=self.delta, @@ -72,7 +72,7 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) + self.assertGreaterEqual(eps_f1, 0.9) def test_run_one_step(self): """Test the run_one_step method.""" diff --git a/test/algorithms/test_decoupled.py b/test/algorithms/test_decoupled.py index 26e02cb..40ee84e 100644 --- a/test/algorithms/test_decoupled.py +++ b/test/algorithms/test_decoupled.py @@ -16,14 +16,14 @@ def setUp(self): """A basic setup for the model.""" set_seed(SEED) - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.dataset_name = "Test" self.order = ComponentwiseOrder(2) self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality self.noise_var = 0.00001 self.costs = [1.0, 1.5] - self.cost_budget = 64 + self.cost_budget = 24 self.algorithm = DecoupledGP( dataset_name=self.dataset_name, order=self.order, @@ -56,14 +56,14 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) # Even though algorithm is not using epsilon. + self.assertGreaterEqual(eps_f1, 0.9) # Even though algorithm is not using epsilon. self.assertLess(self.algorithm.total_cost, self.cost_budget + max(self.costs)) self.assertLessEqual(self.algorithm.total_cost, self.algorithm.round * max(self.costs)) self.assertGreaterEqual(self.algorithm.total_cost, self.algorithm.round * min(self.costs)) def test_run_one_step(self): """Test the run_one_step method.""" - num_rounds = 10 + num_rounds = 5 alg_done = False for i in range(num_rounds): # Run for 10 rounds, it should be enough. if not alg_done and i <= 3: # Save the state at round 3 at the latest. diff --git a/test/algorithms/test_epal.py b/test/algorithms/test_epal.py index 6069fd9..7414083 100644 --- a/test/algorithms/test_epal.py +++ b/test/algorithms/test_epal.py @@ -17,13 +17,13 @@ def setUp(self): # Set random seed for reproducibility set_seed(SEED) - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.noise_var = 0.00001 self.dataset_name = "Test" - self.conf_contraction = 9 + self.conf_contraction = 128 - self.iter_count = 10 + self.iter_count = 5 self.output_dim = 2 self.order = ComponentwiseOrder(self.output_dim) self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality diff --git a/test/algorithms/test_naive.py b/test/algorithms/test_naive.py index 50b882b..adb1f10 100644 --- a/test/algorithms/test_naive.py +++ b/test/algorithms/test_naive.py @@ -48,7 +48,7 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) + self.assertGreaterEqual(eps_f1, 0.9) def test_run_one_step(self): """Test the run_one_step method.""" diff --git a/test/algorithms/test_paveba.py b/test/algorithms/test_paveba.py index 22f0a0d..5a7dacb 100644 --- a/test/algorithms/test_paveba.py +++ b/test/algorithms/test_paveba.py @@ -17,13 +17,13 @@ def setUp(self): """A basic setup for the model.""" set_seed(SEED) - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.dataset_name = "Test" self.order = ComponentwiseOrder(2) self.noise_var = 0.00001 self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality - self.conf_contraction = 1 + self.conf_contraction = 1024 self.algo = PaVeBa( epsilon=self.epsilon, delta=self.delta, @@ -57,13 +57,11 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) + self.assertGreaterEqual(eps_f1, 0.9) def test_run_one_step(self): """Test the run_one_step method.""" - self.algo.conf_contraction = 32 - - num_rounds = 10 + num_rounds = 5 alg_done = False for i in range(num_rounds): # Run for 10 rounds, it should be enough. if not alg_done and i <= 3: # Save the state at round 3 at the latest. @@ -83,7 +81,7 @@ def test_compute_radius(self): self.algo.run_one_step() t1 = 8 * self.noise_var t2 = np.log((np.pi**2 * (3) * self.dataset_cardinality) / (6 * 0.1)) - r1 = np.sqrt(t1 * t2) + r1 = np.sqrt(t1 * t2) / self.conf_contraction r2 = self.algo.compute_radius() self.assertTrue(r1 == r2) diff --git a/test/algorithms/test_paveba_gp.py b/test/algorithms/test_paveba_gp.py index 8b11594..fb165b1 100644 --- a/test/algorithms/test_paveba_gp.py +++ b/test/algorithms/test_paveba_gp.py @@ -17,13 +17,13 @@ def setUp(self): # A basic setup for the model. set_seed(SEED) - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.dataset_name = "Test" self.order = ComponentwiseOrder(2) self.noise_var = 0.00001 self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality - self.conf_contraction = 4 + self.conf_contraction = 256 self.algo = PaVeBaGP( epsilon=self.epsilon, delta=self.delta, @@ -56,11 +56,11 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) + self.assertGreaterEqual(eps_f1, 0.9) def test_run_one_step_with_hyperrectangle(self): """Test the run_one_step method.""" - num_rounds = 10 + num_rounds = 5 alg_done = False for i in range(num_rounds): # Run for 10 rounds, it should be enough. if not alg_done and i <= 3: # Save the state at round 3 at the latest. @@ -88,7 +88,7 @@ def test_run_one_step_with_ellipsoid(self): type="DE", ) - num_rounds = 5 + num_rounds = 3 alg_done = False for i in range(num_rounds): # Run for 10 rounds, it should be enough. if not alg_done and i <= 2: # Save the state at round 3 at the latest. diff --git a/test/algorithms/test_paveba_partial_gp.py b/test/algorithms/test_paveba_partial_gp.py index 7d5115d..321f494 100644 --- a/test/algorithms/test_paveba_partial_gp.py +++ b/test/algorithms/test_paveba_partial_gp.py @@ -17,15 +17,15 @@ def setUp(self): """A basic setup for the model.""" set_seed(SEED) - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.dataset_name = "Test" self.order = ComponentwiseOrder(2) self.dataset_cardinality = get_dataset_instance(self.dataset_name)._cardinality self.noise_var = 0.00001 - self.conf_contraction = 4 + self.conf_contraction = 32 self.costs = [1.0, 1.5] - self.cost_budget = 64 + self.cost_budget = 24 self.algo = PaVeBaPartialGP( epsilon=self.epsilon, delta=self.delta, @@ -61,14 +61,14 @@ def test_whole_class(self): list(pareto_indices), self.epsilon, ) - self.assertTrue(eps_f1 > 0.9) + self.assertGreaterEqual(eps_f1, 0.9) self.assertLess(self.algo.total_cost, self.cost_budget + max(self.costs)) self.assertLessEqual(self.algo.total_cost, self.algo.round * max(self.costs)) self.assertGreaterEqual(self.algo.total_cost, self.algo.round * min(self.costs)) def test_run_one_step(self): """Test the run_one_step method.""" - num_rounds = 10 + num_rounds = 5 alg_done = False for i in range(num_rounds): # Run for 10 rounds, it should be enough. if not alg_done and i <= 3: # Save the state at round 3 at the latest. diff --git a/test/algorithms/test_vogp.py b/test/algorithms/test_vogp.py index 52c3487..5eb1caf 100644 --- a/test/algorithms/test_vogp.py +++ b/test/algorithms/test_vogp.py @@ -24,14 +24,14 @@ def setUp(self): set_seed(SEED) # Parameters for VOGP instance - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.noise_var = 0.00001 - self.conf_contraction = 4 + self.conf_contraction = 64 self.dataset_name = "Test" self.order = ComponentwiseOrder(2) - self.iter_count = 10 + self.iter_count = 5 # Create the VOGP instance self.algorithm = VOGP( diff --git a/test/algorithms/test_vogp_ad.py b/test/algorithms/test_vogp_ad.py index e3ac561..d1990b5 100644 --- a/test/algorithms/test_vogp_ad.py +++ b/test/algorithms/test_vogp_ad.py @@ -21,15 +21,13 @@ def setUp(self): set_seed(SEED) # Parameters for VOGP instance - self.epsilon = 0.1 + self.epsilon = 0.2 self.delta = 0.1 self.noise_var = 0.00001 self.problem_name = "BraninCurrin" self.problem: ContinuousProblem = get_continuous_problem(self.problem_name, self.noise_var) self.order = ComponentwiseOrder(2) - self.conf_contraction = 64 - - self.iter_count = 1 + self.conf_contraction = 128 # Create the VOGP instance self.algorithm = VOGP_AD( @@ -78,5 +76,5 @@ def test_whole_class(self): ) self.assertLessEqual( - log_hv_discrepancy, -3.5, "Log. hypervolume discrepancy should be reasonably low." + log_hv_discrepancy, -2.5, "Log. hypervolume discrepancy should be reasonably low." ) diff --git a/test/models/test_gpytorch.py b/test/models/test_gpytorch.py index ebe62f1..628db6b 100644 --- a/test/models/test_gpytorch.py +++ b/test/models/test_gpytorch.py @@ -292,7 +292,7 @@ def setUp(self): def test_get_model_without_initial_data(self): """Test model creation when X and Y are not provided.""" - self.problem.evaluate.return_value = np.random.randn(1024, self.output_dim) + self.problem.evaluate.return_value = np.random.randn(512, self.output_dim) model = get_gpytorch_modellist_w_known_hyperparams( problem=self.problem, diff --git a/vopy/models/gpytorch.py b/vopy/models/gpytorch.py index 7bae9a6..8254ae4 100644 --- a/vopy/models/gpytorch.py +++ b/vopy/models/gpytorch.py @@ -439,7 +439,7 @@ def get_gpytorch_model_w_known_hyperparams( :rtype: GPyTorchMultioutputExactModel """ if X is None: - X = generate_sobol_samples(problem.in_dim, 1024) # TODO: magic number + X = generate_sobol_samples(problem.in_dim, 512) # TODO: magic number if Y is None: Y = problem.evaluate(X) @@ -795,7 +795,7 @@ def get_gpytorch_modellist_w_known_hyperparams( :rtype: GPyTorchModelListExactModel """ if X is None: - X = generate_sobol_samples(problem.in_dim, 1024) # TODO: magic number + X = generate_sobol_samples(problem.in_dim, 512) # TODO: magic number if Y is None: Y = problem.evaluate(X)