Skip to content

Commit

Permalink
removed vestigial apply_new_noise member functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwpriest committed Sep 27, 2023
1 parent 398e057 commit b328140
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
22 changes: 0 additions & 22 deletions MuyGPyS/gp/multivariate_muygps.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,25 +378,3 @@ def optimize_scale(
scales = mm.assign(scales, new_scale_val[0], i)
self.scale._set(scales)
return self

def apply_new_noise(self, new_noise):
"""
Updates the heteroscedastic noise parameters of a MultivariateMuyGPs
model.
Args:
new_noise:
A matrix of shape
`(test_count, nn_count, nn_count, response_count)` containing
the measurement noise corresponding to the nearest neighbors
of each test point and each response.
Returns:
A MultivariateMuyGPs model with updated heteroscedastic noise
parameters.
"""
ret = deepcopy(self)
for i, model in enumerate(ret.models):
model.noise = HeteroscedasticNoise(new_noise[:, :, :, i], "fixed")
model._mean_fn = PosteriorMean(model.noise)
model._var_fn = PosteriorVariance(model.noise, model.scale)
return ret
22 changes: 0 additions & 22 deletions MuyGPyS/gp/muygps.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,28 +337,6 @@ def fast_posterior_mean(
"""
return self._fast_posterior_mean_fn(Kcross, coeffs_tensor)

def apply_new_noise(self, new_noise: NoiseFn):
"""
Updates the homo/heteroscedastic noise parameter(s) of a MuyGPs model.
To be used when the MuyGPs model has been trained and needs to be
used for prediction, or if multiple batches are needed during training
of a heteroscedastic model.
Args:
new_noise:
If homoscedastic, a float to update the nugget parameter.
If heteroscedastic, a matrix of shape
`(test_count, nn_count)` containing the measurement
noise corresponding to the nearest neighbors of each test point.
Returns:
A MuyGPs model with updated noise parameter(s).
"""
ret = deepcopy(self)
ret.noise = new_noise
ret._mean_fn = PosteriorMean(ret.noise)
ret._var_fn = PosteriorVariance(ret.noise, ret.scale)
return ret

def get_opt_mean_fn(self) -> Callable:
"""
Return a posterior mean function for use in optimization.
Expand Down

0 comments on commit b328140

Please sign in to comment.