Relaxed Gaussian processes¶
The gpmpcontrib.regp package exports predict and
select_optimal_threshold_above_t0. Lower-level functions, including
remodel, are defined in gpmpcontrib.regp.regp.
Function contracts¶
- get_membership_indices(zi, R)
Assign observations to relaxation intervals.
zihas shape(n,)or(n, 1).Ris a list of intervals[lower, upper]. Returns an integer NumPy array with shape(n,). Value0means that the observation is outside all relaxation intervals. Positive values identify the interval index starting at1.
- split_data(xi, zi, ei, R)
Split observations according to membership indices. Returns
(x0, z0, ind0)for non-relaxed rows and(x1, z1, bounds, ind1)for relaxed rows.boundscontains the interval bounds associated with each relaxed observation.
- make_regp_criterion_with_gradient(model, x0, z0, x1)
Build a differentiable reGP criterion for SciPy optimization. Returns
(crit_pre_grad, dcrit). The first callable evaluates the objective and caches the gradient graph. The second callable returns the gradient for the same parameter vector.
- gpmpcontrib.regp.regp.remodel(model, xi, zi, R, covparam0=None, info=False, verbosity=0, convert_in=True, convert_out=True)
Optimize covariance parameters and relaxed observation values.
xihas shape(n, d)andzihas shape(n,)or(n, 1). Ifcovparam0isNone, the function computes an anisotropic initial guess. Returns(model, zi_relaxed, ind_relaxed). Withinfo=True, returns(model, zi_relaxed, ind_relaxed, info_ret).The supplied
modelis modified in place through itscovparamfield.
- gpmpcontrib.regp.predict(model, xi, zi, xt, R, covparam0=None, info=False, verbosity=0)
Run
remodeland predict atxt. Returns(zi_relaxed, (zpm, zpv), model, info_ret).info_retisNonewheninfo=False.
- gpmpcontrib.regp.select_optimal_threshold_above_t0(model, xi, zi, t0, G=20)
Evaluate
Gthresholds abovet0and return the interval[[threshold, inf]]with the smallest tCRPS criterion.
The membership, split, criterion, and remodel functions are lower-level
helpers. Import them from gpmpcontrib.regp.regp when direct access is
needed.