diff --git a/obsidian/acquisition/config.py b/obsidian/acquisition/config.py index 4665757..9404353 100644 --- a/obsidian/acquisition/config.py +++ b/obsidian/acquisition/config.py @@ -44,5 +44,5 @@ 'NIPV': {}, 'EHVI': {'ref_point': {'val': None, 'optional': True}}, 'NEHVI': {'ref_point': {'val': None, 'optional': True}}, - 'NParEGO': {'scalarization_weights': {'val': [1], 'optional': True}}, + 'NParEGO': {'scalarization_weights': {'val': None, 'optional': True}}, } diff --git a/obsidian/optimizer/bayesian.py b/obsidian/optimizer/bayesian.py index 343b26b..aab2e1a 100644 --- a/obsidian/optimizer/bayesian.py +++ b/obsidian/optimizer/bayesian.py @@ -459,7 +459,7 @@ def _validate_hypers(self, if hps.get(key) is None: if not defaults['optional']: raise ValueError(f'Must specify hyperpameter value {key} for {aq_str}') - if key in ['scalarization_weights', 'weights']: + if key in ['weights']: #['scalarization_weights', 'weights']: aq_hps[key] = defaults['val'] * o_dim else: aq_hps[key] = defaults['val'] @@ -551,6 +551,13 @@ def _parse_aq_kwargs(self, qmc_samples = draw_sobol_samples(bounds=X_bounds, n=128, q=m_batch) aq_kwargs['mc_points'] = qmc_samples.squeeze(-2) + if aq == 'NParEGO': + w = hps['scalarization_weights'] + if isinstance(w,list): + w = torch.tensor(w) + w = w/torch.sum(torch.abs(w)) + aq_kwargs['scalarization_weights'] = w + return aq_kwargs def suggest(self,