.. index:: pair: struct; gpr::laplace::SliceSamplerState .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state: struct gpr::laplace::SliceSamplerState ====================================== .. toctree:: :hidden: Overview ~~~~~~~~ Diagnostics + cached state from a slice-sampling run. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct SliceSamplerState { // fields std::vector :ref:`theta_samples`; std::vector :ref:`alpha_cache`; int :ref:`n_steps` = 0; int :ref:`n_target_evals` = 0; int :ref:`n_accepted` = 0; int :ref:`n_stuck` = 0; bool :ref:`valid` = false; }; .. _details-structgpr_1_1laplace_1_1_slice_sampler_state: 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 ------ .. index:: pair: variable; theta_samples .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1a3a595b14118a6b5c4374e3b3e9991a4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector theta_samples ``n_samples`` posterior samples in theta-space (nat-log hyperparameter coordinates). .. index:: pair: variable; alpha_cache .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1a81898394159ebc40a195b452104ca87c: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector alpha_cache Cached ``alpha_k = K(theta_k)^-1 :ref:`y ``` for each retained sample. Empty if the caller chose not to cache (alpha_fn was null in the sample() call). .. index:: pair: variable; n_steps .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1a91910e7323d49b9802cf545514b0d18c: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_steps = 0 Total slice steps taken (including burn-in). .. index:: pair: variable; n_target_evals .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1ac582cbe306e6ef14bad15bcf02b4ddf9: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_target_evals = 0 Total target-function evaluations (NLML calls = Cholesky factorisations). Diagnostics for the per-fit burst cost. .. index:: pair: variable; n_accepted .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1ada8e8264779557f1aef04346553cfa4c: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_accepted = 0 Number of accepted proposals (for acceptance-rate diagnostics). .. index:: pair: variable; n_stuck .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1a8733ee9f9806f7db9954c6a82ed5923b: .. ref-code-block:: cpp :class: doxyrest-title-code-block int n_stuck = 0 Number of stuck steps (max_shrinks reached without accepting). .. index:: pair: variable; valid .. _doxid-structgpr_1_1laplace_1_1_slice_sampler_state_1a3573cc99cb8805ca35c450cabbd87e9c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool valid = false True iff the cache contains usable ``n_samples`` samples and is safe to read. Cleared by the caller on data-update.