Add qConstrainedLogEI#6744
Conversation
| ) | ||
|
|
||
|
|
||
| class qConstrainedLogEI(qLogEI): |
There was a problem hiding this comment.
Is it possible to encapsulate qLogEI instead of inheriting it?
Although inheritance works fine in Python, nested inheritance usually obfuscates codes, so I'd prefer avoid it.
There was a problem hiding this comment.
Maybe we can do so by using composition as is done in other acquisition functions for constrained optimization (i.e., ConstrainedLogEI and ConstrainedLogEHVI). This would also reduce inconsistency in the implementation strategy.
There was a problem hiding this comment.
Thank you for the review! I agree that the nested inheritance was hard to follow. I've updated the implementation to encapsulate it instead.
| def _get_log_improvement(self, joint_x: torch.Tensor) -> torch.Tensor: | ||
| if np.isneginf(self._threshold): | ||
| return torch.zeros(x.shape[:-1], dtype=torch.float64) | ||
| return joint_x.sum() * 0.0 + torch.zeros( |
There was a problem hiding this comment.
| return joint_x.sum() * 0.0 + torch.zeros( | |
| return torch.zeros( |
This term is not needed if we multiply by 0.0
|
@sawa3030 Cc: @kAIto47802 |


Motivation
PR #6640 introduced a Monte Carlo-based acquisition function for unconstrained single-objective optimization in GPSampler. This PR extends the approach to constrained single-objective optimization.
Description of the changes