-
Notifications
You must be signed in to change notification settings - Fork 563
Add constant_constraint to ConstantMean #2082
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
Conversation
ba6d8be
to
1314acd
Compare
:type constant_prior: ~gpytorch.priors.Prior, optional | ||
:param constant_constraint: Constraint for constant parameter :math:`C`. | ||
:type constant_constraint: ~gpytorch.priors.Interval, optional | ||
:param batch_shape: The batch shape of the learned constant(s) (default: []). | ||
:type batch_shape: torch.Size, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistency nit
:type constant_prior: ~gpytorch.priors.Prior, optional | |
:param constant_constraint: Constraint for constant parameter :math:`C`. | |
:type constant_constraint: ~gpytorch.priors.Interval, optional | |
:param batch_shape: The batch shape of the learned constant(s) (default: []). | |
:type batch_shape: torch.Size, optional | |
:type constant_prior: ~gpytorch.priors.Prior, optional. | |
:param constant_constraint: Constraint for constant parameter :math:`C`. | |
:type constant_constraint: ~gpytorch.priors.Interval, optional. | |
:param batch_shape: The batch shape of the learned constant(s) (default: []). | |
:type batch_shape: torch.Size, optional. |
:param batch_shape: The batch shape of the learned constant(s) (default: []). | ||
:type batch_shape: torch.Size, optional | ||
|
||
:var torch.Tensor constant: :math:`C` parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:var torch.Tensor constant: :math:`C` parameter | |
:var torch.Tensor constant: :math:`C` parameter. |
else: # Weird edge case where someone set both `prior` and `constant_prior` | ||
warnings.warn( | ||
"You have set both the `constant_prior` and the deprecated `prior` arguments for ConstantMean. " | ||
"`prior` is deprecated, and will be ignored.", | ||
DeprecationWarning, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is weird enough that we may just want to throw an error here?
cornellius-gp/gpytorch#2082 changed the shape of the mean constant (and did some other things). These changes fix the resulting unit test breakages.
cornellius-gp/gpytorch#2082 changed the shape of the mean constant (and did some other things). These changes fix the resulting unit test breakages.
Summary: cornellius-gp/gpytorch#2082 changed the shape of the mean constant (and did some other things). These changes fix the resulting unit test breakages. This requires the botorch change pytorch/botorch#1343 Pull Request resolved: facebook#1055 Reviewed By: lena-kashtelyan Differential Revision: D38527699 Pulled By: Balandat fbshipit-source-id: 86a9a9fb272cebb923e2fafc76fd44624f1069d0
Summary: cornellius-gp/gpytorch#2082 changed the shape of the mean constant (and did some other things). These changes fix the resulting unit test breakages. Pull Request resolved: #1343 Reviewed By: saitcakmak Differential Revision: D38527688 Pulled By: Balandat fbshipit-source-id: a9878b3ff5d045b18c3330f4e0707a3ee4be2553
Summary: cornellius-gp/gpytorch#2082 changed the shape of the mean constant (and did some other things). These changes fix the resulting unit test breakages. This requires the botorch change pytorch/botorch#1343 Pull Request resolved: #1055 Reviewed By: lena-kashtelyan Differential Revision: D38527699 Pulled By: Balandat fbshipit-source-id: e2c13d78d4ce25e35152a0e19a23e2b107627d37
Previously, ConstantMean only supported a prior on the constant (not a constraint). This PR adds a
constant_constraint
kwarg to ConstantMean.Backwards compatibility
There are two non-backwards compatible changes to ConstantMean, though there is a state_dict hook to ensure that previous state dicts can be loaded:
constant
parameter is renamed toraw_constant
.raw_constant
is now*batch_shape
, rather than*batch_shape x 1
.[Fixes #2074]