Fix output tensor dimension in degenerate optimize_acqf
call
#2743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #2740
@sdaulton: This is a draft for fixing the dimensionality issue. While the PR technically solves the problem, think it only addresses the symptom and not the underlying root cause. For the latter, I'd need some guidance from your end.
Specifically, something seems fishy about the tensor dimensions promised by the acquisition function base class. The docstring states that the input is a
(b) x q x d
-dim tensor and the output is a(b)
-dim. The way I understand this is thatb
is an optional batching dimension. But if you read the contract, it would imply:b x q x d
-dim tensor, you get ab
-dim tensor back.q x d
-dim tensor, you get a dimensionless tensor (i.e. scalar value) back.Now the problem is that the second part seems to be actually violated, which causes the the problem in #2740. Interestingly, when writing the test, I wanted to use a
MockAcquisitionFunction()
object for it like done in other tests. However, that object does seem to fulfill the contract, so I couldn't even reproduce the problem with the mock but had to reuse the code from my original minimal example.Any thoughts how we should go about this, i.e. is this actually a more fundamental problem in the acquisition function code?
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
A corresponding test has been included.