Loading...
Searching...
No Matches
GP/TP model (Tier 2)

Classes

struct  gpr_noise_floor_report
 Noise a trained model conditions on and the interval's certificate margin (ABI 1.14). More...

Typedefs

typedef struct gpr_noise_floor_report gpr_noise_floor_report_t
 Noise a trained model conditions on and the interval's certificate margin (ABI 1.14).

Functions

gpr_model_t gpr_model_create (gpr_model_type_t type)
 Create a GP or TP model. Returns NULL on failure.
void gpr_model_destroy (gpr_model_t model)
 Destroy model. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A second call reports GPR_ERR_INVALID_ARG through gpr_last_status() and does not free the handle again.
gpr_model_type_t gpr_model_type (gpr_model_t model)
 Query model type.
int gpr_model_init (gpr_model_t model, const gpr_model_config_t *config, gpr_atoms_t atoms)
 Initialize model with configuration and atom setup. Must be called before train(). Can be called again to reconfigure: the model is rebuilt, so it is untrained and later fits start from the library defaults exactly as on a fresh handle.
int gpr_model_train (gpr_model_t model, const double *R, const double *E, const double *G, int n_obs, int n_coords)
 Train the model on observations.
int gpr_model_train_marginal_likelihood_checked (gpr_model_t model, const double *R, size_t R_len, const double *E, size_t E_len, const double *G, size_t G_len, int n_obs, int n_coords, gpr_marginal_likelihood_report_t *report, double *lengthscales, size_t lengthscales_len)
 Fit all supplied rows by prior-free Gaussian marginal likelihood (ABI 1.13).
void gpr_train_phase_reset (void)
 Zero the train-phase walls. The next train or predict accumulates into a fresh sample. Any pointer passed to gpr_train_phase_read may be NULL.
int gpr_model_fit_iterations (gpr_model_t model)
 Iterations the last train ran, or -1 when the model is missing.
int gpr_model_fit_restarts (gpr_model_t model, int *out)
 Restarts the last train needed (ABI 1.15).
const char * gpr_model_fit_stop_reason (gpr_model_t model)
 Why the last train stopped, as a static string.
void gpr_train_phase_read (double *factor_s, double *solve_s, double *eigen_s, double *kernel_s, double *hessian_s)
 Read the walls accumulated since the last reset. factor is the Cholesky factor, solves are the triangular substitutions, eigen is the stable-basis symmetric eigensolve, kernel is kernel assembly, hessian is the hyperparameter gradient.
void gpr_train_phase_read_leaves (double *setup_s, double *descriptor_s, double *posterior_s, double *subset_s, double *objective_s, double *condition_s, double *cache_s, double *curvature_s, double *energy_s, double *schedule_s)
 Read the leaves that sit beside the five train walls. setup is model preparation, descriptor is the dual-kernel features, posterior is the weight solve after the eigensolve, subset is the optimization sample, objective is the marginal likelihood, and condition is the full-data rebuild. Any pointer may be NULL. objective and condition wrap other leaves. The disjoint coverage sum is factor, solve, eigen, kernel, gradient, curvature, energy, schedule, setup, cache, descriptor, posterior, and subset.
int gpr_model_update (gpr_model_t model, const double *R_new, const double *E_new, const double *G_new, int n_new, int n_coords)
 Incremental update: append observations and retrain.
int gpr_model_predict (gpr_model_t model, const double *R_query, double *E_out, double *G_out, int n_coords)
 Predict energy and gradient at a query point.
int gpr_model_prediction_factors (gpr_model_t model, const double *R_query, int n_coords, double *energy, double *scale, double *mean, double *kstar, double *weights, int capacity, int *order)
 Factors of one trained energy prediction. energy is the library prediction. scale and mean undo the training standardization of the kernel contraction. kstar and weights hold that contraction, in the trained factor order, and order receives their length. capacity is the buffer length for both arrays.
int gpr_model_predict_variance (gpr_model_t model, const double *R_query, double *var_E_out, double *var_G_out, int n_coords)
 Predict variance at a query point.
int gpr_model_predict_full (gpr_model_t model, const double *R_query, double *E_out, double *G_out, double *var_E_out, double *var_G_out, int n_coords)
 Predict energy, gradient, and variance in one call.
int gpr_model_predict_batch (gpr_model_t model, const double *R_queries, double *E_out, double *G_out, double *var_E_out, double *var_G_out, int n_queries, int n_coords)
 Batch prediction at multiple query points. var_E_out and var_G_out may be NULL to skip variance.
int gpr_model_train_checked (gpr_model_t model, const double *R, size_t R_len, const double *E, size_t E_len, const double *G, size_t G_len, int n_obs, int n_coords)
 Extent-checked forms of the training and prediction calls (ABI 1.11).
int gpr_model_update_checked (gpr_model_t model, const double *R_new, size_t R_len, const double *E_new, size_t E_len, const double *G_new, size_t G_len, int n_new, int n_coords)
 Extent-checked gpr_model_update (ABI 1.11).
int gpr_model_append_fixed_checked (gpr_model_t model, const double *R_new, size_t R_len, const double *E_new, size_t E_len, const double *G_new, size_t G_len, int n_new, int n_coords)
 Append rows at the fitted hyperparameters by a Cholesky block update (ABI 1.13).
int gpr_model_calibrate_forces_checked (gpr_model_t model, const double *R_holdout, size_t R_len, const double *G_true, size_t G_len, int n_holdout, int n_coords, double nominal_probability, gpr_calibration_report_t *report)
 Evaluate true-force calibration on held-out rows (ABI 1.13).
int gpr_model_calibrate_loo_checked (gpr_model_t model, double nominal_probability, gpr_calibration_report_t *report)
 Closed-form leave-one-out calibration of all training channels (ABI 1.13).
int gpr_model_predict_checked (gpr_model_t model, const double *R_query, size_t R_len, double *E_out, double *G_out, size_t G_len, int n_coords)
 Extent-checked gpr_model_predict (ABI 1.11).
int gpr_model_predict_variance_checked (gpr_model_t model, const double *R_query, size_t R_len, double *var_E_out, double *var_G_out, size_t var_G_len, int n_coords)
 Extent-checked gpr_model_predict_variance (ABI 1.11).
int gpr_model_predict_full_checked (gpr_model_t model, const double *R_query, size_t R_len, double *E_out, double *G_out, size_t G_len, double *var_E_out, double *var_G_out, size_t var_G_len, int n_coords)
 Extent-checked gpr_model_predict_full (ABI 1.11).
int gpr_model_predict_batch_checked (gpr_model_t model, const double *R_queries, size_t R_len, double *E_out, size_t E_len, double *G_out, size_t G_len, double *var_E_out, size_t var_E_len, double *var_G_out, size_t var_G_len, int n_queries, int n_coords)
 Extent-checked gpr_model_predict_batch (ABI 1.11).
int gpr_model_predict_hessian (gpr_model_t model, const double *R_query, double *H_out, int n_coords)
 Dense Hessian of the posterior mean at a query point.
int gpr_model_predict_hessian_checked (gpr_model_t model, const double *R_query, size_t R_len, double *H_out, size_t H_len, int n_coords)
 Extent-checked mean-Hessian prediction (ABI 1.24).
int gpr_model_predict_hessian_action (gpr_model_t model, const double *R_query, const double *v, double *Hv_out, int n_coords)
 One action of the prepared posterior-mean Hessian (ABI 1.8): Hv_out = H(R_query) v.
int gpr_model_predict_hessian_action_checked (gpr_model_t model, const double *R_query, size_t R_len, const double *v, size_t v_len, double *Hv_out, size_t Hv_len, int n_coords)
 Extent-checked mean-Hessian action (ABI 1.12).
int gpr_model_prediction_supported (gpr_model_t model, const double *R_query, int n_coords, int *supported)
 Whether the trained prediction kernel supports a query (ABI 1.12).
int gpr_model_prediction_supported_checked (gpr_model_t model, const double *R_query, size_t R_len, int n_coords, int *supported)
 Extent-checked prediction-support query (ABI 1.12).
int gpr_model_predict_energy_variance_interval (gpr_model_t model, const double *R_queries, int n_queries, int n_coords, double *var_E_lower_out, double *var_E_upper_out)
 Certified energy-variance enclosure [lower, upper] for each query (ABI 1.14).
int gpr_model_predict_energy_variance_interval_checked (gpr_model_t model, const double *R_queries, size_t R_len, int n_queries, int n_coords, double *var_E_lower_out, size_t var_E_lower_len, double *var_E_upper_out, size_t var_E_upper_len)
 Extent-checked energy-variance enclosure (ABI 1.14).
int gpr_model_get_noise_floor_report (gpr_model_t model, gpr_noise_floor_report_t *out)
 Report the condition-floored noise and certificate gap of a trained model (ABI 1.14).

Detailed Description

Typedef Documentation

◆ gpr_noise_floor_report_t

Noise a trained model conditions on and the interval's certificate margin (ABI 1.14).

All noise values are in the units of gpr_model_get_sigma2. sigma2_requested is the likelihood variance plus the jitter, sigma2_floored is that noise after the condition floor every mean, log-determinant, LOO and interval route applies (the noise the trained factor inverts), and floor_active is 1 when the floor raised it. certificate_gap is eps_k - lambda_min_cert of the exact-kernel factor: K + sigma2 I is certified positive definite exactly when sigma2 exceeds it, so it is nonpositive when the factor certifies without noise. sigma2_interval is the noise gpr_model_predict_energy_variance_interval certifies, equal to sigma2_floored. certified is 1 when sigma2_floored exceeds certificate_gap, that is when K + sigma2_floored I is certified positive definite. A platform with no extended-precision working type reports certified 0 and an infinite certificate_gap.

Function Documentation

◆ gpr_model_append_fixed_checked()

int gpr_model_append_fixed_checked ( gpr_model_t model,
const double * R_new,
size_t R_len,
const double * E_new,
size_t E_len,
const double * G_new,
size_t G_len,
int n_new,
int n_coords )

Append rows at the fitted hyperparameters by a Cholesky block update (ABI 1.13).

No hyperparameter optimization or full factorization is attempted. Returns GPR_ERR_UNSUPPORTED when the live posterior cannot be extended in place.

◆ gpr_model_calibrate_forces_checked()

int gpr_model_calibrate_forces_checked ( gpr_model_t model,
const double * R_holdout,
size_t R_len,
const double * G_true,
size_t G_len,
int n_holdout,
int n_coords,
double nominal_probability,
gpr_calibration_report_t * report )

Evaluate true-force calibration on held-out rows (ABI 1.13).

G_true is the true energy gradient; force residual signs are converted internally. The held-out rows are never added to the fitted model. Standardized residuals use latent force variances after removing the reported training-residual multiplier. Exactly deterministic components with exactly zero residual are omitted without a variance floor. The nominal probability must produce a finite, representable central Gaussian quantile.

◆ gpr_model_calibrate_loo_checked()

int gpr_model_calibrate_loo_checked ( gpr_model_t model,
double nominal_probability,
gpr_calibration_report_t * report )

Closed-form leave-one-out calibration of all training channels (ABI 1.13).

Uses Rasmussen & Williams (2006), section 5.4.2, directly from the active posterior's weights and inverse diagonal. It performs no oracle calls and does not alter the fitted model. The report uses the same residual, coverage, scale and log-density fields as held-out force calibration; posterior_variance_scale is 1 because this calculation uses the fitted covariance itself. The nominal probability must produce a finite, representable central Gaussian quantile.

◆ gpr_model_create()

gpr_model_t gpr_model_create ( gpr_model_type_t type)

Create a GP or TP model. Returns NULL on failure.

◆ gpr_model_destroy()

void gpr_model_destroy ( gpr_model_t model)

Destroy model. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A second call reports GPR_ERR_INVALID_ARG through gpr_last_status() and does not free the handle again.

◆ gpr_model_fit_iterations()

int gpr_model_fit_iterations ( gpr_model_t model)

Iterations the last train ran, or -1 when the model is missing.

The count is rgmin's SCG steps plus the L-BFGS fallback steps that finish a stalled rgmin SCG fit. After a restarted marginal-likelihood fit this sums both passes.

◆ gpr_model_fit_restarts()

int gpr_model_fit_restarts ( gpr_model_t model,
int * out )

Restarts the last train needed (ABI 1.15).

gpr_model_train_marginal_likelihood_checked restarts once when its first start fails to converge and reports 1; every other train reports 0. The count is also written when the restart fails and the fit returns GPR_ERR_OPTIMIZER. GPR_ERR_NULL_HANDLE for a NULL model and GPR_ERR_INVALID_ARG for an uninitialised model or a NULL out, which leave *out unwritten.

◆ gpr_model_fit_stop_reason()

const char * gpr_model_fit_stop_reason ( gpr_model_t model)

Why the last train stopped, as a static string.

"budget" when an rgmin fit exhausts its iteration budget, "library" when it does not. "restored scg point" when a rejected L-BFGS fallback restores the SCG point. "wall-clock limit" when the wall is already spent. "non-finite marginal likelihood" when a failed fit keeps a non-finite input marginal likelihood. "unset" before any train. "missing" for a NULL handle. Never NULL. Do not free.

◆ gpr_model_get_noise_floor_report()

int gpr_model_get_noise_floor_report ( gpr_model_t model,
gpr_noise_floor_report_t * out )

Report the condition-floored noise and certificate gap of a trained model (ABI 1.14).

Requires the model the interval supports: a trained exact-kernel HS-SVD MAP model. Other models return GPR_ERR_UNSUPPORTED and leave *out untouched; a factor that cannot be built returns GPR_ERR_CHOLESKY. An output scale that is not 1 (normalization disabled) and not finite and positive with a normal binary64 square returns GPR_ERR_INVALID_ARG. Builds the same factor the interval uses, so a later interval call reuses it.

◆ gpr_model_init()

int gpr_model_init ( gpr_model_t model,
const gpr_model_config_t * config,
gpr_atoms_t atoms )

Initialize model with configuration and atom setup. Must be called before train(). Can be called again to reconfigure: the model is rebuilt, so it is untrained and later fits start from the library defaults exactly as on a fresh handle.

◆ gpr_model_predict()

int gpr_model_predict ( gpr_model_t model,
const double * R_query,
double * E_out,
double * G_out,
int n_coords )

Predict energy and gradient at a query point.

Parameters
modelTrained model handle
R_queryPositions (n_coords)
E_outPredicted energy (scalar)
G_outPredicted gradient (n_coords, caller-allocated)
n_coordsCoordinate dimension used for training

◆ gpr_model_predict_batch()

int gpr_model_predict_batch ( gpr_model_t model,
const double * R_queries,
double * E_out,
double * G_out,
double * var_E_out,
double * var_G_out,
int n_queries,
int n_coords )

Batch prediction at multiple query points. var_E_out and var_G_out may be NULL to skip variance.

◆ gpr_model_predict_batch_checked()

int gpr_model_predict_batch_checked ( gpr_model_t model,
const double * R_queries,
size_t R_len,
double * E_out,
size_t E_len,
double * G_out,
size_t G_len,
double * var_E_out,
size_t var_E_len,
double * var_G_out,
size_t var_G_len,
int n_queries,
int n_coords )

Extent-checked gpr_model_predict_batch (ABI 1.11).

◆ gpr_model_predict_checked()

int gpr_model_predict_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
double * E_out,
double * G_out,
size_t G_len,
int n_coords )

Extent-checked gpr_model_predict (ABI 1.11).

◆ gpr_model_predict_energy_variance_interval()

int gpr_model_predict_energy_variance_interval ( gpr_model_t model,
const double * R_queries,
int n_queries,
int n_coords,
double * var_E_lower_out,
double * var_E_upper_out )

Certified energy-variance enclosure [lower, upper] for each query (ABI 1.14).

Evaluates the HS-SVD MAP bordered Schur variance enclosure var_E_lower_out[j] <= var_E(x_j) <= var_E_upper_out[j] for n_queries points in R_queries (n_queries * n_coords). Both output arrays have length n_queries. Endpoints are rounded outward to binary64 and scaled by y_scale^2 * calibration_factor.

Preconditions and failure modes:

  • Requires a trained exact-kernel HS-SVD MAP model. Other paths return GPR_ERR_UNSUPPORTED without writing output buffers.
  • The noise is the model's likelihood variance plus jitter, floored by the same condition floor the trained mean, log-determinant and LOO routes invert, so a noise below that floor (an analytic oracle's 0, or an HVP roundoff variance) names the posterior the model was trained on. Both endpoints are the enclosure of that floored noise.
  • Requires K + sigma2 I to be certified positive definite above the factor's eigen/QR backward-error bound at that noise. Certification failure returns GPR_ERR_CHOLESKY. A negative lower endpoint is clamped to zero when the upper endpoint is nonnegative; a negative upper endpoint returns GPR_ERR_CHOLESKY.

◆ gpr_model_predict_energy_variance_interval_checked()

int gpr_model_predict_energy_variance_interval_checked ( gpr_model_t model,
const double * R_queries,
size_t R_len,
int n_queries,
int n_coords,
double * var_E_lower_out,
size_t var_E_lower_len,
double * var_E_upper_out,
size_t var_E_upper_len )

Extent-checked energy-variance enclosure (ABI 1.14).

R_queries must hold at least n_queries*n_coords doubles and each output must hold at least n_queries doubles. Short buffers return GPR_ERR_INVALID_ARG without writing either output.

◆ gpr_model_predict_full()

int gpr_model_predict_full ( gpr_model_t model,
const double * R_query,
double * E_out,
double * G_out,
double * var_E_out,
double * var_G_out,
int n_coords )

Predict energy, gradient, and variance in one call.

◆ gpr_model_predict_full_checked()

int gpr_model_predict_full_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
double * E_out,
double * G_out,
size_t G_len,
double * var_E_out,
double * var_G_out,
size_t var_G_len,
int n_coords )

Extent-checked gpr_model_predict_full (ABI 1.11).

◆ gpr_model_predict_hessian()

int gpr_model_predict_hessian ( gpr_model_t model,
const double * R_query,
double * H_out,
int n_coords )

Dense Hessian of the posterior mean at a query point.

H_out is row-major (n_coords x n_coords). The stored matrix is the symmetric part, and a failing call does not write it. The sources are tried in this order. An active posterior whose background and residual kernels are both exact assembles their matrices. Otherwise, when the model is neither an atomic environment nor an active posterior, a prepared HS-SVD operator applied to the identity is the matrix, and it is tried before any exact MAP kernel Hessian. A failed apply is final: it does not fall through to the exact kernel, the action columns or the fourth-order stencil, GPR_ERR_UNSUPPORTED is returned, and H_out is not written. When that operator is not prepared, a MAP kernel with an exact Hessian assembles the matrix from the columns of its exact action. For the inverse-distance squared exponential, each column applies the prepared extended-precision contraction and its pair-local radial blocks. Refusal of an exact term is final and is not replaced by a finite-difference stencil, including in a mean with one exact term and one generic term. A generic term without an analytic contraction is not a refusal; the matrix is then the columns of the prepared mean-Hessian action, whose generic miss uses the fourth-order stencil of the mean gradient. An atomic-environment model skips the exact and HS-SVD assembly and always uses the dispatched product. GPR_ERR_UNSUPPORTED reports a refusal or an unavailable Hessian.

Parameters
modelTrained model handle
R_queryPositions (n_coords)
H_outHessian (n_coords * n_coords, caller-allocated)
n_coordsCoordinate dimension used for training

◆ gpr_model_predict_hessian_action()

int gpr_model_predict_hessian_action ( gpr_model_t model,
const double * R_query,
const double * v,
double * Hv_out,
int n_coords )

One action of the prepared posterior-mean Hessian (ABI 1.8): Hv_out = H(R_query) v.

An exact kernel that returns no action, or an action that returns false, refuses, including when that term is one part of a mean whose other term is generic. A kernel without an analytic contraction uses the fourth-order gradient stencil. An atomic-environment model uses the dispatched product. A failing call does not write Hv_out. GPR_ERR_UNSUPPORTED reports a missing action or an action that returns false. GPR_ERR_INTERNAL reports a product whose length is not n_coords.

Parameters
modelTrained model handle
R_queryPositions (n_coords)
vDirection (n_coords)
Hv_outProduct (n_coords, caller-allocated)
n_coordsCoordinate dimension used for training

◆ gpr_model_predict_hessian_action_checked()

int gpr_model_predict_hessian_action_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
const double * v,
size_t v_len,
double * Hv_out,
size_t Hv_len,
int n_coords )

Extent-checked mean-Hessian action (ABI 1.12).

R_query, v and Hv_out must each hold at least n_coords doubles. A short buffer returns GPR_ERR_INVALID_ARG before Hv_out is written.

◆ gpr_model_predict_hessian_checked()

int gpr_model_predict_hessian_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
double * H_out,
size_t H_len,
int n_coords )

Extent-checked mean-Hessian prediction (ABI 1.24).

R_query must hold at least n_coords doubles and H_out at least n_coords * n_coords doubles. A short buffer returns GPR_ERR_INVALID_ARG before H_out is written.

◆ gpr_model_predict_variance()

int gpr_model_predict_variance ( gpr_model_t model,
const double * R_query,
double * var_E_out,
double * var_G_out,
int n_coords )

Predict variance at a query point.

◆ gpr_model_predict_variance_checked()

int gpr_model_predict_variance_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
double * var_E_out,
double * var_G_out,
size_t var_G_len,
int n_coords )

Extent-checked gpr_model_predict_variance (ABI 1.11).

◆ gpr_model_prediction_factors()

int gpr_model_prediction_factors ( gpr_model_t model,
const double * R_query,
int n_coords,
double * energy,
double * scale,
double * mean,
double * kstar,
double * weights,
int capacity,
int * order )

Factors of one trained energy prediction. energy is the library prediction. scale and mean undo the training standardization of the kernel contraction. kstar and weights hold that contraction, in the trained factor order, and order receives their length. capacity is the buffer length for both arrays.

◆ gpr_model_prediction_supported()

int gpr_model_prediction_supported ( gpr_model_t model,
const double * R_query,
int n_coords,
int * supported )

Whether the trained prediction kernel supports a query (ABI 1.12).

This is the same correlation-support decision used by the GP active-learning loops; the C API adds no threshold. On success, supported is one inside the kernel support and zero outside it. An initialized but untrained model reports zero.

◆ gpr_model_prediction_supported_checked()

int gpr_model_prediction_supported_checked ( gpr_model_t model,
const double * R_query,
size_t R_len,
int n_coords,
int * supported )

Extent-checked prediction-support query (ABI 1.12).

R_query must hold at least n_coords doubles. A short buffer returns GPR_ERR_INVALID_ARG before supported is written.

◆ gpr_model_train()

int gpr_model_train ( gpr_model_t model,
const double * R,
const double * E,
const double * G,
int n_obs,
int n_coords )

Train the model on observations.

Parameters
modelInitialized model handle
RPositions, row-major (n_obs x n_coords)
EEnergies (n_obs)
GGradients, row-major (n_obs x n_coords)
n_obsNumber of observations
n_coordsCoordinate dimension (3 times the number of moving atoms)

◆ gpr_model_train_checked()

int gpr_model_train_checked ( gpr_model_t model,
const double * R,
size_t R_len,
const double * E,
size_t E_len,
const double * G,
size_t G_len,
int n_obs,
int n_coords )

Extent-checked forms of the training and prediction calls (ABI 1.11).

Each takes the length of every caller buffer, in doubles, after the pointer. A call that would read or write past a buffer returns GPR_ERR_INVALID_ARG, with the buffer named in gpr_last_error(), instead of touching memory the caller does not own. The checks are

  • R, G (train, update): n_obs * n_coords, E: n_obs;
  • R_query, v, G_out, var_G_out, Hv_out: n_coords;
  • H_out: n_coords * n_coords;
  • R_queries, G_out, var_G_out (batch): n_queries * n_coords, E_out and var_E_out: n_queries.

A NULL pointer is not measured: it is rejected, or is an absent optional output, exactly as in the unchecked call, and its length is ignored. Otherwise each call behaves as the call of the same name without the suffix. The Fortran GPModel type calls these.

◆ gpr_model_train_marginal_likelihood_checked()

int gpr_model_train_marginal_likelihood_checked ( gpr_model_t model,
const double * R,
size_t R_len,
const double * E,
size_t E_len,
const double * G,
size_t G_len,
int n_obs,
int n_coords,
gpr_marginal_likelihood_report_t * report,
double * lengthscales,
size_t lengthscales_len )

Fit all supplied rows by prior-free Gaussian marginal likelihood (ABI 1.13).

Every array extent is measured in doubles. lengthscales_len must hold the value returned by gpr_model_n_lengthscales. This entry point installs the fitted posterior exactly as gpr_model_train does. When the first start does not converge the fit restarts once, still prior-free; the report's optimizer_iterations then covers both passes and gpr_model_fit_restarts returns 1.

◆ gpr_model_type()

gpr_model_type_t gpr_model_type ( gpr_model_t model)

Query model type.

◆ gpr_model_update()

int gpr_model_update ( gpr_model_t model,
const double * R_new,
const double * E_new,
const double * G_new,
int n_new,
int n_coords )

Incremental update: append observations and retrain.

◆ gpr_model_update_checked()

int gpr_model_update_checked ( gpr_model_t model,
const double * R_new,
size_t R_len,
const double * E_new,
size_t E_len,
const double * G_new,
size_t G_len,
int n_new,
int n_coords )

Extent-checked gpr_model_update (ABI 1.11).

◆ gpr_train_phase_read()

void gpr_train_phase_read ( double * factor_s,
double * solve_s,
double * eigen_s,
double * kernel_s,
double * hessian_s )

Read the walls accumulated since the last reset. factor is the Cholesky factor, solves are the triangular substitutions, eigen is the stable-basis symmetric eigensolve, kernel is kernel assembly, hessian is the hyperparameter gradient.

◆ gpr_train_phase_read_leaves()

void gpr_train_phase_read_leaves ( double * setup_s,
double * descriptor_s,
double * posterior_s,
double * subset_s,
double * objective_s,
double * condition_s,
double * cache_s,
double * curvature_s,
double * energy_s,
double * schedule_s )

Read the leaves that sit beside the five train walls. setup is model preparation, descriptor is the dual-kernel features, posterior is the weight solve after the eigensolve, subset is the optimization sample, objective is the marginal likelihood, and condition is the full-data rebuild. Any pointer may be NULL. objective and condition wrap other leaves. The disjoint coverage sum is factor, solve, eigen, kernel, gradient, curvature, energy, schedule, setup, cache, descriptor, posterior, and subset.

◆ gpr_train_phase_reset()

void gpr_train_phase_reset ( void )

Zero the train-phase walls. The next train or predict accumulates into a fresh sample. Any pointer passed to gpr_train_phase_read may be NULL.