Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In gp.py, predict() returns incorrectly-sized array, causing IndexError exception in ei_merit(). #48

Open
sjohnson-FLL opened this issue Jan 4, 2023 · 0 comments

Comments

@sjohnson-FLL
Copy link

sjohnson-FLL commented Jan 4, 2023

In gp.py, the predict() method returns an array of size (num_pts,). This does not match the returned size of the predict_std() method, which instead returns an array of size (num_pts,1).

This causes issues in ei_merit.py, in the ei_merit() function. When mu and sig are assigned different sizes on line 23, gamma (and subsequently beta then ei) will become a square array of size (num_pts, num_pts). This causes an IndexError exception on line 31, when the incorrectly-sized ei is indexed by the correctly-sized dmerit.

Potential solution:
In gp.py, in the predict() method, change line 71 to more closely match the form of line 85. Suggestion below:
return self._mu + self._sigma * np.expand_dims(self.model.predict(xx), axis=1)

Note: this issue appeared suddenly for me, without any updates to pySot itself, so it is possible that either:

  1. I introduced this issue by passing in bad values somewhere. However, the proposed fix resolved my issue, so I would say it's not likely that that is the problem.
  2. While I did not track the timing closely, there is a chance that this issue began to occur after upgrading from python 3.7 from 3.11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant