Skip to content

Commit

Permalink
remove unused copy likelihood state_dict in SingleTaskGP (#194)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #194

see title

Reviewed By: danielrjiang

Differential Revision: D16036033

fbshipit-source-id: e85c15f08de9d79e68ad3e5557191164a8e66a1e
  • Loading branch information
sdaulton authored and facebook-github-bot committed Jun 27, 2019
1 parent 3b6d8aa commit ea3f909
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion botorch/models/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _check_compatibility(models: ModelListGP) -> None:
)

# TODO: Add support for custom likelihoods
if any(hasattr(m, "_likelihood_state_dict") for m in models):
if any(getattr(m, "_is_custom_likelihood", False) for m in models):
raise NotImplementedError(
"Conversion of models with custom likelihoods is currently unsupported."
)
Expand Down
3 changes: 1 addition & 2 deletions botorch/models/gp_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Gaussian Process Regression models based on GPyTorch models.
"""

from copy import deepcopy
from typing import Any, Optional

import torch
Expand Down Expand Up @@ -88,7 +87,7 @@ def __init__(
),
)
else:
self._likelihood_state_dict = deepcopy(likelihood.state_dict())
self._is_custom_likelihood = True
ExactGP.__init__(self, train_X, train_Y, likelihood)
self.mean_module = ConstantMean(batch_shape=self._aug_batch_shape)
self.covar_module = ScaleKernel(
Expand Down

0 comments on commit ea3f909

Please sign in to comment.