Skip to content

Commit

Permalink
Merge pull request #37 from MSDLLCpapers/bugfix
Browse files Browse the repository at this point in the history
Bugfix - NParEGO default weights
  • Loading branch information
kstone40 authored Aug 21, 2024
2 parents a8ea740 + 4be7df1 commit f88ee78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions obsidian/optimizer/bayesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ 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 ['weights']: #['scalarization_weights', 'weights']:
aq_hps[key] = defaults['val'] * o_dim
if key in ['weights', 'scalarization_weights']:
aq_hps[key] = [1] * o_dim
else:
aq_hps[key] = defaults['val']

Expand Down Expand Up @@ -553,7 +553,7 @@ def _parse_aq_kwargs(self,

if aq == 'NParEGO':
w = hps['scalarization_weights']
if isinstance(w,list):
if isinstance(w, list):
w = torch.tensor(w)
w = w/torch.sum(torch.abs(w))
aq_kwargs['scalarization_weights'] = w
Expand Down

0 comments on commit f88ee78

Please sign in to comment.