struct gpr::laplace::SliceSamplerState

Overview

Diagnostics + cached state from a slice-sampling run. More…

#include <SliceSampler.h>
 
struct SliceSamplerState {
    // fields
 
    std::vector<Eigen::VectorXd> theta_samples;
    std::vector<Eigen::VectorXd> alpha_cache;
    int n_steps = 0;
    int n_target_evals = 0;
    int n_accepted = 0;
    int n_stuck = 0;
    bool valid = false;
};

Detailed Documentation

Diagnostics + cached state from a slice-sampling run. Persists for the duration of one outer dimer iteration’s predict bursts; the caller is expected to invalidate when the underlying training data, kernel state, or hyperparameter MAP shifts beyond a threshold.

Fields

std::vector<Eigen::VectorXd> theta_samples

n_samples posterior samples in theta-space (nat-log hyperparameter coordinates).

std::vector<Eigen::VectorXd> alpha_cache

Cached alpha_k = K(theta_k)^-1 y for each retained sample. Empty if the caller chose not to cache (alpha_fn was null in the sample() call).

int n_steps = 0

Total slice steps taken (including burn-in).

int n_target_evals = 0

Total target-function evaluations (NLML calls = Cholesky factorisations). Diagnostics for the per-fit burst cost.

int n_accepted = 0

Number of accepted proposals (for acceptance-rate diagnostics).

int n_stuck = 0

Number of stuck steps (max_shrinks reached without accepting).

bool valid = false

True iff the cache contains usable n_samples samples and is safe to read. Cleared by the caller on data-update.