rgpycrumbs.surfaces.gradient_imq

Classes

GradientIMQ

Gradient-enhanced Inverse Multi-Quadratic (IMQ) surface implementation.

Functions

negative_mll_imq_grad(log_params, x, y_flat, D_plus_1)

negative_mll_imq_map(log_params, init_eps, x, y_flat, ...)

_heteroscedastic_noise(noise_per_obs, prior_variance)

Spread each energy noise over its point's gradient components.

_grad_imq_solve(x, y_full, noise_scalar, epsilon[, ...])

_grad_imq_predict(x_query, x_obs, alpha, epsilon)

_grad_imq_var(x_query, x_obs, K_inv, epsilon)

Module Contents

rgpycrumbs.surfaces.gradient_imq.negative_mll_imq_grad(log_params, x, y_flat, D_plus_1)[source]
rgpycrumbs.surfaces.gradient_imq.negative_mll_imq_map(log_params, init_eps, x, y_flat, D_plus_1)[source]
rgpycrumbs.surfaces.gradient_imq._heteroscedastic_noise(noise_per_obs, prior_variance)[source]

Spread each energy noise over its point’s gradient components.

Every component keeps the energy’s ratio of noise to prior variance, so the gradient noise carries the energy noise units divided by length squared, as the gradients themselves do.

Parameters:
  • noise_per_obs – Energy noise variance per point, shape (N,).

  • prior_variance – Prior variances per point, shape (N, D+1), with the energy first.

Returns:

Noise variances in the covariance order, shape (N(D+1),).

rgpycrumbs.surfaces.gradient_imq._grad_imq_solve(x, y_full, noise_scalar, epsilon, noise_per_obs=None)[source]
rgpycrumbs.surfaces.gradient_imq._grad_imq_predict(x_query, x_obs, alpha, epsilon)[source]
rgpycrumbs.surfaces.gradient_imq._grad_imq_var(x_query, x_obs, K_inv, epsilon)[source]
class rgpycrumbs.surfaces.gradient_imq.GradientIMQ(x, y, gradients=None, smoothing=None, length_scale=None, optimize=True, noise_per_obs=None, **_kwargs)[source]

Bases: rgpycrumbs.surfaces._base.BaseGradientSurface

Gradient-enhanced Inverse Multi-Quadratic (IMQ) surface implementation.

Added in version 1.0.0.

Changed in version 1.14.0: Optimized fits no longer pull the noise toward 1e-2. The default epsilon starts at the median distance between inputs. Optimized fits cap the noise at the caller’s smoothing. With noise_per_obs, each gradient component keeps the energy’s ratio of noise to prior variance instead of a tenth of its noise.

_fit(smoothing, length_scale, optimize)[source]

Internal method to perform parameter optimization.

_solve()[source]

Internal method to solve the linear system for weights.

_predict_chunk(chunk)[source]

Internal method for batch prediction.

_var_chunk(chunk)[source]

Internal method for batch variance.