Skip to content

Commit

Permalink
Allow monotonic rejection GP to initialize its inducing point allocat…
Browse files Browse the repository at this point in the history
…or from config. (facebookresearch#485)

Summary:
Pull Request resolved: facebookresearch#485

Monotonic rejection GP used to completely ignore any inducing point config, now it follows other models.

Differential Revision: D67225873
  • Loading branch information
JasonKChow authored and facebook-github-bot committed Dec 14, 2024
1 parent 521af32 commit 45f9362
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions aepsych/models/monotonic_rejection_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,9 @@ def __init__(
dim=self.dim
)

# TODO: This allocator *must* be SobolAllocator and not the set one. This
# suggests that this model doesn't actually properly use data for inducing
# points properly.
inducing_points = SobolAllocator(
bounds=torch.stack([lb, ub]), dim=self.dim
).allocate_inducing_points(num_inducing=self.inducing_size)
inducing_points = self.inducing_point_method.allocate_inducing_points(
num_inducing=self.inducing_size
)

inducing_points_aug = self._augment_with_deriv_index(inducing_points, 0)
variational_distribution = CholeskyVariationalDistribution(
Expand Down Expand Up @@ -169,7 +166,7 @@ def fit(self, train_x: torch.Tensor, train_y: torch.Tensor, **kwargs) -> None:
self.inducing_points = self.inducing_point_method.allocate_inducing_points(
num_inducing=self.inducing_size,
covar_module=self.covar_module,
inputs=self._augment_with_deriv_index(self.train_inputs[0], 0),
X=self._augment_with_deriv_index(self.train_inputs[0], 0),
)
self._set_model(train_x, train_y)

Expand Down

0 comments on commit 45f9362

Please sign in to comment.