.. index:: pair: class; gpr::GaussianProcessRegression .. _doxid-classgpr_1_1_gaussian_process_regression: class gpr::GaussianProcessRegression ==================================== .. toctree:: :hidden: enum_gpr_GaussianProcessRegression_LikelihoodNoiseVarianceUpdate.rst enum_gpr_GaussianProcessRegression_MeanHessianProductStatus.rst enum_gpr_GaussianProcessRegression_MeasuredRowVerdict.rst enum_gpr_GaussianProcessRegression_MixtureMeanHessianStatus.rst enum_gpr_GaussianProcessRegression_ObjectiveBackend.rst enum_gpr_GaussianProcessRegression_VarianceConvention.rst struct_gpr_GaussianProcessRegression_ActiveKernelEvidence.rst struct_gpr_GaussianProcessRegression_ActivePosteriorState.rst struct_gpr_GaussianProcessRegression_AnnealStageSummary.rst struct_gpr_GaussianProcessRegression_AtomicEnvironmentParameterState.rst struct_gpr_GaussianProcessRegression_BaseKernelExecutionConfig.rst struct_gpr_GaussianProcessRegression_CachedVarianceSolve.rst struct_gpr_GaussianProcessRegression_ConvergedSubsetFit.rst struct_gpr_GaussianProcessRegression_FittedHyperparameterDensity.rst struct_gpr_GaussianProcessRegression_ForceCalibrationReport.rst struct_gpr_GaussianProcessRegression_HssvdDualLocalModel.rst struct_gpr_GaussianProcessRegression_KrylovObjectiveState.rst struct_gpr_GaussianProcessRegression_LaplacePosteriorFactor.rst struct_gpr_GaussianProcessRegression_LaplacePosteriorSignature.rst struct_gpr_GaussianProcessRegression_LaplacePosteriorStamp.rst struct_gpr_GaussianProcessRegression_LaplacePosteriorState.rst struct_gpr_GaussianProcessRegression_LaplaceTrainingCovarianceGeometry.rst struct_gpr_GaussianProcessRegression_LeaveOneOutCalibrationReport.rst struct_gpr_GaussianProcessRegression_LengthScaleFitState.rst struct_gpr_GaussianProcessRegression_LengthScaleTies.rst struct_gpr_GaussianProcessRegression_MarginalLikelihoodReport.rst struct_gpr_GaussianProcessRegression_ObjectivePlan.rst struct_gpr_GaussianProcessRegression_OptimizationObjectiveFrame.rst struct_gpr_GaussianProcessRegression_OptimizerState.rst struct_gpr_GaussianProcessRegression_PreparedHssvdHessianVector.rst struct_gpr_GaussianProcessRegression_ProfileSplitTotals.rst struct_gpr_GaussianProcessRegression_ScgStallScope.rst struct_gpr_GaussianProcessRegression_SecantQuadraticPriorState.rst struct_gpr_GaussianProcessRegression_SerialFactorSignature.rst struct_gpr_GaussianProcessRegression_SliceLaplaceState.rst struct_gpr_GaussianProcessRegression_farthest_point_sampling_t.rst class_gpr_GaussianProcessRegression_ActivePosteriorRestorePoint.rst class_gpr_GaussianProcessRegression_HyperparameterPosterior.rst class_gpr_GaussianProcessRegression_RefitTrustReport.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class GaussianProcessRegression { public: // typedefs typedef std::function :target:`MeanHessianAction`; typedef std::function<:ref:`MeanHessianAction`(const Eigen::VectorXd&)> :target:`MeanHessianPreparation`; // enums enum :ref:`LikelihoodNoiseVarianceUpdate`; enum :ref:`MeanHessianProductStatus`; enum :ref:`MeasuredRowVerdict`; enum :ref:`MixtureMeanHessianStatus`; enum :ref:`ObjectiveBackend`; enum :ref:`VarianceConvention`; // structs struct :ref:`ActiveKernelEvidence`; struct :ref:`ActivePosteriorState`; struct :ref:`AnnealStageSummary`; struct :ref:`AtomicEnvironmentParameterState`; struct :ref:`BaseKernelExecutionConfig`; struct :ref:`CachedVarianceSolve`; struct :ref:`ConvergedSubsetFit`; struct :ref:`FittedHyperparameterDensity`; struct :ref:`ForceCalibrationReport`; struct :ref:`HssvdDualLocalModel`; struct :ref:`KrylovObjectiveState`; struct :ref:`LaplacePosteriorFactor`; struct :ref:`LaplacePosteriorSignature`; struct :ref:`LaplacePosteriorStamp`; struct :ref:`LaplacePosteriorState`; struct :ref:`LaplaceTrainingCovarianceGeometry`; struct :ref:`LeaveOneOutCalibrationReport`; struct :ref:`LengthScaleFitState`; struct :ref:`LengthScaleTies`; struct :ref:`MarginalLikelihoodReport`; struct :ref:`ObjectivePlan`; struct :ref:`OptimizationObjectiveFrame`; struct :ref:`OptimizerState`; struct :ref:`PreparedHssvdHessianVector`; struct :ref:`ProfileSplitTotals`; struct :ref:`ScgStallScope`; struct :ref:`SecantQuadraticPriorState`; struct :ref:`SerialFactorSignature`; struct :ref:`SliceLaplaceState`; struct :ref:`farthest_point_sampling_t`; // classes class :ref:`ActivePosteriorRestorePoint`; class :ref:`HyperparameterPosterior`; class :ref:`RefitTrustReport`; // fields std::unique_ptr<:ref:`SexpatCF`> :target:`sexpat_cov_func`; // construction :target:`GaussianProcessRegression`(); :target:`GaussianProcessRegression`(std::shared_ptr`> communication); virtual :target:`~GaussianProcessRegression`(); // methods :ref:`linalg::MpiContext` :target:`mpiContext`() const; Eigen::VectorXd :ref:`solveTrainingCovarianceInFactorLayout`(const Eigen::VectorXd& rhs) const; void :ref:`initialize`(const :ref:`InputParameters`& parameters, const :ref:`AtomsConfiguration`& conf_info); bool :target:`initialized`() const; void :target:`setConditionedHessian`(const Eigen::VectorXd& point, const Eigen::MatrixXd& hessian); void :target:`clearConditionedHessians`(); bool :target:`findConditionedHessian`(const Eigen::VectorXd& point, Eigen::MatrixXd& hessian_out) const; void :ref:`setModelProfile`(:ref:`GPModelProfile` profile); :ref:`GPModelProfile` :target:`getModelProfile`() const; void :ref:`setAtomicEnvironmentModel`(bool enabled); bool :target:`atomicEnvironmentModelEnabled`() const; bool :target:`atomicEnvironmentPosteriorBuilt`() const; Eigen::Index :target:`atomicEnvironmentInducingCount`() const; :ref:`AtomicEnvironmentParameterState` :target:`atomicEnvironmentParameterState`() const; void :ref:`restoreAtomicEnvironmentParameterState`(const :ref:`AtomicEnvironmentParameterState`& state); void :ref:`setHyperparameters`(const :ref:`Observation`& all_obs, const :ref:`AtomsConfiguration`& conf_info, const bool update_sexpat_cf_param = true, const bool update_const_cf_param = true, const bool update_sqrt_prior_param = true); bool :ref:`configureModeRefit`(const :ref:`Observation`& oracle, const :ref:`Coord`& mode, double force_tolerance, :ref:`ConvergenceNormType` force_norm = :ref:`ConvergenceNormType::L2_NORM`); bool :ref:`configureMinimumModeRefit`(const :ref:`Observation`& oracle, double force_tolerance, :ref:`ConvergenceNormType` force_norm = :ref:`ConvergenceNormType::L2_NORM`, const :ref:`RefitTrustReport`* trust_report = nullptr); :ref:`MeasuredRowVerdict` :ref:`measuredRowsAgreeWithPosterior`(const :ref:`Observation`& rows, :ref:`ConvergenceNormType` force_norm, double* max_force_error = nullptr, double* max_force_sd = nullptr, double* evidence_nats = nullptr, double variance_calibration = 1.0, :ref:`RefitTrustReport`* trust_report = nullptr); void :ref:`markHyperparametersFitted`(); void :ref:`setOptimizationRowPool`(std::vector pool); void :target:`clearOptimizationRowPool`(); std::vector :ref:`holdLengthScalesUnresolvedBySubset`(const :ref:`Observation`& subset); void :ref:`setOptimizationRequiredRows`(:ref:`Coord` positions); void :target:`clearOptimizationRequiredRows`(); void :target:`clearModeRefitHint`(); void :target:`setActivePosteriorRefits`(bool enabled); bool :target:`activePosteriorRefitsEnabled`() const; void :ref:`setEnvironmentResiduals`(bool enabled); bool :target:`environmentResidualsEnabled`() const; void :ref:`setAdditivePairResiduals`(bool enabled); bool :target:`additivePairResidualsEnabled`() const; const std::vector<:ref:`ActiveKernelEvidence`>& :target:`activeKernelEvidence`() const; double :ref:`activeFitStartForTesting`() const; Eigen::Index :ref:`activeFitAnchorCountForTesting`() const; Eigen::Index :ref:`activeFitSupportCountForTesting`() const; Eigen::Index :ref:`residualInducingCount`() const; Eigen::Index :target:`residualConfigurationCount`() const; bool :target:`hasPendingActivePosteriorRefit`() const; bool :ref:`hasPendingResidualModelRefit`() const; void :ref:`setUpDefault`(); void :ref:`evaluateTrainingCovarianceMatrix`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool serial_per_rank = false, bool include_constant = true, bool include_noise = true); bool :target:`prepareTrainingKernelGeometry`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`TrainingKernelGeometry`& out, bool reused = false) const; const :ref:`TrainingKernelGeometry`* :ref:`fitGeometryFor`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind) const; void :target:`releaseFitGeometry`() const; std::size_t :target:`fitGeometryBuildsForTesting`() const; bool :target:`evaluateTrainingCovarianceMatrixFromGeometry`(const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool serial_per_rank = false, bool include_constant = true, bool include_noise = true); bool :ref:`evaluateActiveCovarianceFromGeometry`(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, :ref:`EigenMatrix`& covariance, bool serial_per_rank = false, std::vector<:ref:`EigenMatrix`>* covariance_derivatives = nullptr); bool :ref:`evaluateActiveCovarianceFromGeometry`(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, :ref:`EigenMatrix`& covariance, bool serial_per_rank, std::vector<:ref:`EigenMatrix`>* covariance_derivatives, const std::vector& derivative_lengths); bool :ref:`contractActiveCovarianceDerivatives`(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, const :ref:`EigenMatrix`& weight, const std::vector& derivative_lengths, Eigen::VectorXd& contractions, bool serial_per_rank = false); void :target:`evaluateEnergyAndGradientFromGeometry`(const Eigen::VectorXd& w, const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); void :target:`evaluateLeaveOneOutEnergyAndGradientFromGeometry`(const Eigen::VectorXd& w, const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); void :target:`evaluateLocalNeighborhoodLooEnergyAndGradientFromGeometry`(const Eigen::VectorXd& w, const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); double :target:`evaluateLocalNeighborhoodLooEnergy`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y); double :target:`evaluateLocalNeighborhoodLooGeometryTermForTesting`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::Index geometry_index); double :target:`evaluateEnergy`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y); bool :ref:`evaluateGradientAfterEnergy`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& gradient); double :target:`evaluateEnergyFromGeometry`(const Eigen::VectorXd& w, const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y); bool :target:`evaluateGradientAfterEnergyFromGeometry`(const Eigen::VectorXd& w, const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& gradient); std::size_t :target:`trainingGeometryApplyCallsForTesting`() const; bool :ref:`evaluateTrainingCovarianceInFactorOrder`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool include_noise = true); bool :target:`evaluateTrainingCovarianceInFactorOrderFromGeometry`(const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool include_noise = true); std::size_t :target:`factorOrderAssembliesForTesting`() const; bool :ref:`evaluateTrainingCrossCovarianceInFactorOrder`(const :ref:`EigenMatrix`& query, const Eigen::VectorXd& query_ind, :ref:`EigenMatrix`& cross) const; :ref:`EigenMatrix` :ref:`trainingCrossCovarianceInFactorRows`(const :ref:`EigenMatrix`& query, const Eigen::VectorXd& query_ind, bool serial_per_rank) const; std::size_t :target:`factorOrderCrossAssembliesForTesting`() const; void :ref:`evaluateHyperparameterObjectiveEnergyAndGradient`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); double :target:`computeObjectiveStationarityShiftNorm`(const :ref:`EigenMatrix`& opt_R_matrix, const Eigen::VectorXd& opt_R_indices, const Eigen::VectorXd& opt_y, const Eigen::VectorXd& theta_reference, Eigen::VectorXd* shift_out = nullptr, double* energy_out = nullptr, Eigen::VectorXd* gradient_out = nullptr); int :ref:`lastRefitKind`() const; double :ref:`lastStationarityShift`() const; double :target:`lastStationarityThreshold`() const; int :target:`lastStationarityModel`() const; bool :ref:`refreshFullDataPosteriorIfObjectiveStationary`(const :ref:`Observation`& full_observation, double* shift_norm_out = nullptr); double :ref:`computeLaplaceSkipScgShiftNorm`(const :ref:`EigenMatrix`& opt_R_matrix, const Eigen::VectorXd& opt_R_indices, const Eigen::VectorXd& opt_y); void :ref:`evaluateCovarianceMatrix`(const :ref:`EigenMatrix`& x1, const :ref:`EigenMatrix`& x2, const Eigen::VectorXd& x1_ind, const Eigen::VectorXd& x2_ind, :ref:`EigenMatrix`& C, bool serial_per_rank = false) const; void :ref:`extractUniqueIndices`(const Eigen::VectorXd& input_ind, Eigen::VectorXd& output_ind) const; void :ref:`evaluateEnergyAndGradient`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); void :ref:`optimize`(const :ref:`Observation`& observation); :ref:`MarginalLikelihoodReport` :ref:`optimizeMarginalLikelihood`(const :ref:`Observation`& observation); bool :ref:`appendFixedHyperparameters`(const :ref:`Observation`& full_observation); Eigen::Index :target:`fullFitObservationCount`() const; Eigen::Index :target:`fullFitCoordinateCount`() const; :ref:`ForceCalibrationReport` :ref:`calibrateHeldOutForces`(const :ref:`Observation`& held_out, double nominal_probability); :ref:`LeaveOneOutCalibrationReport` :ref:`calibrateLeaveOneOut`(double nominal_probability) const; :ref:`LikelihoodNoiseVarianceUpdate` :ref:`setLikelihoodNoiseVariance`(double physical_sigma2, const :ref:`Observation`* full_observation = nullptr); :ref:`LikelihoodNoiseVarianceUpdate` :target:`setLikelihoodNoiseVariance`(double physical_sigma2, const :ref:`Observation`& full_observation); bool :ref:`applyLikelihoodNoiseVarianceFloor`(double floor_sigma2, const :ref:`Observation`& full_observation); void :ref:`evaluatePriorMeanTargets`(const Eigen::VectorXd& positions, double& energy, Eigen::VectorXd& gradient) const; void :ref:`optimizeFactorized`(const :ref:`Observation`& observation); void :ref:`optimizeChemistryFactorized`(const :ref:`Observation`& observation); bool :ref:`observationBandInfluence`(const :ref:`Observation`& observation, const :ref:`Coord`& band_positions, Eigen::VectorXd& influence, bool collective = false); bool :ref:`observationBandInfluence`(const :ref:`Observation`& observation, const :ref:`Coord`& band_positions, Eigen::VectorXd& influence, bool collective, const std::vector& protected_rows, Eigen::VectorXd* removal_norm = nullptr); void :target:`setChemFactorizedHyperparameters`(bool enabled); void :ref:`setPhysicsCollocationPath`(const :ref:`Coord`& path_points); bool :target:`getChemFactorizedHyperparameters`() const; void :ref:`calculatePotential`(:ref:`Observation`& image1); bool :target:`calculateMeanHessianVectorHssvd`(const :ref:`Coord`& R, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector) const; bool :ref:`calculateMeanHessianVectorDispatched`(const :ref:`Coord`& R, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector); :ref:`MixtureMeanHessianStatus` :ref:`calculateLaplaceMixtureMeanHessianVector`(const :ref:`Coord`& R, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector); :ref:`MeanHessianAction` :ref:`prepareMeanHessian`(const :ref:`Coord`& R); bool :ref:`calculateMeanHessian`(const :ref:`Coord`& R, Eigen::MatrixXd& hessian); bool :ref:`calculateExactDirectionalCurvature`(const :ref:`Coord`& R, const Eigen::VectorXd& direction, double& curvature); :ref:`MeanHessianAction` :ref:`prepareAnalyticMeanHessian`(const :ref:`Coord`& R); bool :target:`prepareMeanHessianVectorHssvd`(const :ref:`Coord`& R, :ref:`PreparedHssvdHessianVector`& prepared) const; bool :target:`applyMeanHessianVectorHssvd`(const :ref:`PreparedHssvdHessianVector`& prepared, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector) const; bool :target:`applyMeanHessianBlockHssvd`(const :ref:`PreparedHssvdHessianVector`& prepared, const Eigen::MatrixXd& directions, Eigen::MatrixXd& hessian_block) const; void :ref:`calculatePotentialLaplace`(:ref:`Observation`& image1); void :ref:`calculatePotentialLaplaceSlice`(:ref:`Observation`& image1); void :ref:`calculateVarianceLaplaceSlice`(:ref:`Observation`& image1); void :ref:`setUncertaintyMode`(:ref:`UncertaintyMode` mode); :ref:`UncertaintyMode` :target:`getUncertaintyMode`() const; :ref:`HyperparameterPosterior` :ref:`retainHyperparameterPosterior`(); :ref:`HyperparameterPosterior` :ref:`currentHyperparameterPosterior`() const; bool :ref:`conditionOnHyperparameterPosterior`(const :ref:`HyperparameterPosterior`& posterior); void :ref:`setUseAlphaKPredictMean`(bool use); bool :target:`getUseAlphaKPredictMean`() const; void :ref:`setUseAlphaKLaplaceMean`(bool use); bool :target:`getUseAlphaKLaplaceMean`() const; void :target:`setLaplaceSkipScgThreshold`(double threshold); double :target:`getLaplaceSkipScgThreshold`() const; void :target:`setObjectiveStationaritySkipThreshold`(double threshold); double :target:`getObjectiveStationaritySkipThreshold`() const; void :target:`setObjectiveStationaritySkipAuto`(bool use); void :ref:`setFitStepStop`(bool use); bool :target:`getObjectiveStationaritySkipAuto`() const; bool :target:`objectiveStationaritySkipMayBeActive`() const; bool :target:`usesFullObservationForHyperparameterOptimization`(const :ref:`Observation`& observation) const; double :target:`objectiveStationaritySkipThresholdForTesting`(const Eigen::VectorXd& theta_reference) const; bool :target:`hasObjectiveStationarityHessianForTesting`() const; bool :target:`hasObjectiveStationarityInverseHessianForTesting`() const; void :target:`setObjectiveStationarityHessianCholForTesting`(const Eigen::MatrixXd& U); void :target:`setObjectiveStationarityInverseHessianForTesting`(const Eigen::MatrixXd& H_inverse); void :target:`setObjectiveStationarityBbInverseScaleForTesting`(Eigen::Index dimension, double inverse_scale); void :target:`setSliceLaplaceHessianCholForTesting`(const Eigen::MatrixXd& U); void :target:`setUseTrainingGeometryHandle`(bool use); bool :target:`getUseTrainingGeometryHandle`() const; void :target:`setProfilePredictMean`(bool enabled); bool :target:`getProfilePredictMean`() const; void :target:`setProfileEnergySplit`(bool enabled); bool :target:`getProfileEnergySplit`() const; void :target:`setProfileGradientSplit`(bool enabled); bool :target:`getProfileGradientSplit`() const; const :ref:`ProfileSplitTotals`& :target:`profileSplitTotals`() const; void :target:`resetProfileSplitTotals`(); void :target:`logProfileSplitSummary`(); void :target:`setHutchinsonProbes`(int num_probes); int :target:`getHutchinsonProbes`() const; void :target:`setHssvdBackend`(bool enabled); bool :target:`getHssvdBackend`() const; void :ref:`setRigidNullDeflation`(bool enabled); bool :target:`rigidNullDeflationEnabled`() const; const :ref:`RigidDeflationDiagnostic`& :target:`rigidDeflationDiagnostic`() const; bool :target:`hasReusableHssvdPosterior`() const; void :target:`setHssvdObjectiveContractions`(bool enabled); bool :target:`getHssvdObjectiveContractions`() const; void :target:`setHssvdDualChopTolerance`(double tol); double :target:`getHssvdDualChopTolerance`() const; void :target:`setHssvdDualRandomizedSketch`(int sketch_size); int :target:`getHssvdDualRandomizedSketch`() const; void :target:`setHssvdDualLapackRrr`(bool enabled); bool :target:`getHssvdDualLapackRrr`() const; void :target:`setHssvdLocalActiveSetSize`(int size); int :target:`getHssvdLocalActiveSetSize`() const; void :target:`setHssvdLocalPosteriorActiveSetSize`(int size); int :target:`getHssvdLocalPosteriorActiveSetSize`() const; void :ref:`setMapMeanKernelForTesting`(std::shared_ptr`> kernel); void :ref:`setMapMeanKernelOverridesHssvdForTesting`(bool override); bool :ref:`installActivePosteriorHessianActionsForTesting`(:ref:`MeanHessianPreparation` background, bool background_exact, :ref:`MeanHessianPreparation` residual, bool residual_exact); void :target:`resetHssvdHessianVectorCallsForTesting`() const; void :ref:`setHssvdHessianBlockApplyFailsForTesting`(bool fail) const; std::size_t :target:`getHssvdHessianVectorCallsForTesting`() const; void :ref:`resetDispatchedMapMeanHessianActionsForTesting`() const; std::size_t :ref:`getDispatchedMapMeanHessianActionsForTesting`() const; void :target:`setDisableOutputNormalization`(bool d); void :ref:`setPriorMeanStatistic`(:ref:`PriorMeanStatistic` statistic); :ref:`PriorMeanStatistic` :target:`priorMeanStatistic`() const; bool :target:`getDisableOutputNormalization`() const; void :ref:`setOutputScaleFloor`(bool enabled); bool :target:`outputScaleFloor`() const; void :ref:`synchronizeOutputTransformFrom`(const :ref:`GaussianProcessRegression`& source); void :ref:`restoreOutputTransform`(double mean, double scale, bool frozen_mean); double :target:`outputMean`() const; double :target:`outputScale`() const; bool :target:`outputMeanFrozen`() const; void :ref:`setPopulationPrior`(:ref:`priors::PopulationPrior` prior); const :ref:`priors::PopulationPrior`& :target:`populationPrior`() const; void :ref:`applyPopulationPrior`(const :ref:`AtomsConfiguration`& conf_info, const Eigen::VectorXd& ls_k, double own_s2_log); void :target:`setUseLsPrior`(bool use); bool :target:`getUseLsPrior`() const; void :ref:`setUseLogNormalMagnPrior`(bool use); bool :target:`useLogNormalMagnPrior`() const; void :ref:`setLengthScaleSeedChemicalFloor`(bool enabled); bool :target:`getLengthScaleSeedChemicalFloor`() const; void :ref:`setRobustNu`(double nu); double :target:`robustNu`() const; bool :ref:`updateRobustRowWeights`(const :ref:`Observation`& full_observation); const Eigen::VectorXd& :target:`robustResidualNormsForTesting`() const; const Eigen::VectorXd& :target:`robustExtraNoiseForTesting`() const; :ref:`LengthScaleFitState` :target:`lengthScaleFitState`() const; void :target:`restoreLengthScaleFitState`(const :ref:`LengthScaleFitState`& state); void :target:`configureLengthScaleTies`(const :ref:`AtomsConfiguration`& configuration); const :ref:`LengthScaleTies`& :target:`lengthScaleTies`() const; void :target:`setLengthScaleTies`(bool enabled); void :ref:`releaseLengthScaleTieForTesting`(:ref:`Index_t` member); int :ref:`lastTieScreenProbes`() const; bool :target:`lastTieScreenUsedHessianVector`() const; const std::vector& :target:`lastTieScreenCurvatures`() const; bool :ref:`lengthScaleTiesActive`(Eigen::Index length_count) const; void :ref:`tieLengthScaleParameters`(Eigen::VectorXd& theta) const; void :ref:`poolDescriptorScaleByTies`(Eigen::VectorXd& scales) const; void :ref:`reduceTiedLengthScaleGradient`(Eigen::VectorXd& gradient) const; void :ref:`refreshLengthScaleLeaders`(); void :ref:`setPairLocalTiles`(bool enabled); bool :target:`pairLocalTilesEnabled`() const; void :ref:`setPairLocalDirectionalTiles`(bool enabled); void :target:`setPrincipledNugget`(bool use); bool :target:`getPrincipledNugget`() const; void :target:`setKappaMax`(double kappa_max); double :target:`getKappaMax`() const; void :target:`setUseZBLPriorMean`(bool use); bool :target:`getUseZBLPriorMean`() const; void :ref:`setUseFFPriorMean`(bool use); void :ref:`setSecantQuadraticPrior`(const Eigen::VectorXd& position, const Eigen::VectorXd& gradient, const Eigen::MatrixXd& hessian, double reference_energy); void :target:`clearSecantQuadraticPrior`(); :ref:`SecantQuadraticPriorState` :target:`retainSecantQuadraticPrior`() const; void :ref:`restoreSecantQuadraticPrior`(const :ref:`SecantQuadraticPriorState`& state); bool :ref:`physicalPriorMeanActive`() const; bool :ref:`samplePhysicalPriorMean`(const Eigen::VectorXd& position, double& energy, Eigen::VectorXd& gradient) const; const Eigen::MatrixXd& :target:`secantQuadraticHessian`() const; void :ref:`addLayeredPriorHessianAction`(const Eigen::VectorXd& position, const Eigen::VectorXd& direction, Eigen::VectorXd& action) const; int :target:`secantQuadraticPriorUses`() const; bool :target:`secantQuadraticPriorActive`() const; bool :target:`getUseFFPriorMean`() const; void :target:`setLogTrainingGeometry`(bool enabled); bool :target:`getLogTrainingGeometry`() const; void :target:`setLogRankBlockCholesky`(bool enabled); bool :target:`getLogRankBlockCholesky`() const; void :target:`setScalapackBlockSize`(int block_size); int :target:`getScalapackBlockSize`() const; void :target:`setScalapackNprow`(int nprow); int :target:`getScalapackNprow`() const; void :target:`setCutlassPluginPath`(std::string path); const std::string& :target:`getCutlassPluginPath`() const; void :ref:`setUsePsisLaplace`(bool use); bool :target:`getUsePsisLaplace`() const; void :ref:`setUsePsisDeterministicGrid`(bool use); bool :target:`getUsePsisDeterministicGrid`() const; void :ref:`setUseDeltaMethod`(bool use); bool :target:`getUseDeltaMethod`() const; void :ref:`setDeltaUHMinDiag`(double v); double :target:`getDeltaUHMinDiag`() const; void :target:`setDeltaMaxRatio`(double v); double :target:`getDeltaMaxRatio`() const; void :ref:`buildRFFModel`(const :ref:`Observation`& training_data, int D_rff); void :target:`calculatePotentialRFF`(:ref:`Observation`& image); void :target:`calculateVarianceRFF`(:ref:`Observation`& image); int :target:`getRFFFeatures`() const; bool :target:`isRFFBuilt`() const; void :ref:`setRFFFeaturesRequested`(int D_rff); int :target:`getRFFFeaturesRequested`() const; void :ref:`enableRFFFeatureSelection`(double force_tol_fraction = 0.0); bool :target:`rffFeatureSelectionAuto`() const; double :target:`rffForceTolFraction`() const; :ref:`RFFFeatureSelection` :ref:`selectRFFFeatures`(const :ref:`Observation`& observation, std::uint64_t memory_cap_bytes = :ref:`kRFFValidationMemoryCapBytes`); const :ref:`RFFFeatureSelection`& :target:`rffFeatureSelection`() const; void :ref:`setHyperparameterOptimizationMode`(:ref:`HyperparameterOptimizationMode` mode); void :ref:`setRgminMethod`(rgmin_method_t m); void :ref:`setVarianceSubsetConfigurations`(int configurations); void :ref:`setVarianceSubsetFootprint`(bool enabled); bool :target:`varianceSubsetFootprint`() const; void :target:`setVarianceSubsetConfigurationIds`(std::vector ids); const std::vector& :target:`varianceSubsetConfigurationIds`() const; std::size_t :target:`varianceSubsetQueriesForTesting`() const; std::size_t :target:`varianceSubsetFactorizationsForTesting`() const; void :ref:`setAnnealStage`(bool enabled, std::size_t budget, std::size_t replicas, std::size_t every, std::uint64_t seed); void :ref:`noteSurrogateContradiction`(); const :ref:`AnnealStageSummary`& :ref:`lastAnnealStage`() const; std::size_t :ref:`lastFitEvaluationsForTesting`() const; std::size_t :ref:`rgminWarmStartsForTesting`() const; std::size_t :ref:`rgminWarmPairsForTesting`() const; void :ref:`setRgminWarmStart`(bool keep); void :ref:`forgetRgminSessions`(); :ref:`HyperparameterOptimizationMode` :target:`getHyperparameterOptimizationMode`() const; const char* :target:`getHyperparameterOptimizerBackend`() const; void :target:`setHyperparameterObjectiveMode`(:ref:`HyperparameterObjectiveMode` mode); :ref:`HyperparameterObjectiveMode` :target:`getHyperparameterObjectiveMode`() const; virtual bool :ref:`exactNlmlHessianVectorAvailable`() const; bool :ref:`nlmlHessianVectorCurvatureRequested`() const; int :ref:`nlmlHessianVectorFallbacks`() const; void :ref:`noteNlmlHessianVectorFallback`(const char* where, const char* why); void :ref:`setOptimizationSubsetHistory`(int rows); int :target:`getOptimizationSubsetHistory`() const; void :ref:`setSubsetFailureEscalation`(bool enabled); bool :target:`subsetFailureEscalation`() const; void :ref:`setRgminInitialLogMove`(double distance); double :target:`rgminInitialLogMove`() const; void :ref:`setRgminInitialLogMoveWholeSession`(bool whole_session); void :ref:`setSkipUnchangedSubsetFit`(bool enabled); bool :target:`skipUnchangedSubsetFit`() const; std::size_t :ref:`unchangedSubsetFitSkipsForTesting`() const; std::size_t :ref:`lastFitConfigurationsForTesting`() const; bool :ref:`lastWarmStartInfeasible`() const; Eigen::VectorXd :ref:`fittedKernelParameters`() const; void :target:`setHyperparameterActiveMaskForTesting`(const std::vector& mask); void :target:`setScgMaxIterationsForTesting`(:ref:`Index_t` max_iter); void :ref:`setWallClockLimit`(std::shared_ptr`> limit); bool :ref:`wallClockLimitReached`() const; void :target:`setResidualDiagonalCorrectionForTesting`(bool use, double eps); void :ref:`setNlmlHessianVectorFailureForTesting`(bool fail); void :target:`setScgDampingLimitForTesting`(double limit); void :ref:`setFitTolerancesForTesting`(double objective, double step); void :ref:`setObjectiveBackend`(:ref:`ObjectiveBackend` backend, Eigen::Index rank = 0); void :target:`setObjectiveBackendForTesting`(:ref:`ObjectiveBackend` backend, Eigen::Index rank = 0); :ref:`ObjectiveBackend` :target:`lastObjectiveBackend`() const; :ref:`ObjectivePlan` :target:`objectivePlan`() const; const :ref:`linalg::linop::DenseResultCache`& :target:`denseResultsForTesting`() const; std::size_t :target:`gradientReplicatedInverseEntriesForTesting`() const; double :ref:`fitStepTolerance`() const; bool :target:`lastScgFallbackUsedForTesting`() const; bool :target:`scgStalledForTesting`() const; void :ref:`setRequireScgFallbackImprovement`(bool enabled); bool :target:`requiresScgFallbackImprovement`() const; bool :target:`lastScgHitIterationBudgetForTesting`() const; int :target:`lastFitIterations`() const; int :ref:`lastFitRestarts`() const; const char* :target:`lastFitStopReason`() const; void :target:`resetLaplacePosteriorSignatureBuildsForTesting`() const; std::size_t :target:`laplacePosteriorSignatureBuildsForTesting`() const; bool :ref:`scaleLaplaceFactorForTesting`(std::size_t index, double scale); void :target:`setForceFactorOwnerLaplaceMeanForTesting`(bool value); bool :ref:`disableLaplaceFactorsForTesting`(); void :target:`resetLaplaceMeanBlockPartitionCallsForTesting`() const; std::size_t :target:`laplaceMeanBlockPartitionCallsForTesting`() const; void :target:`resetIncrementalCholeskyCountersForTesting`() const; void :ref:`invalidateTrainingFactorCache`(); std::size_t :target:`incrementalCholeskyUpdatesForTesting`() const; std::size_t :target:`fullCholeskyFactorizationsForTesting`() const; std::size_t :target:`serialFactorReusesForTesting`() const; bool :ref:`devicePosteriorLiveForTesting`() const; bool :ref:`residentTrainingFactorRetainedForTesting`() const; bool :ref:`devicePosteriorCapableForTesting`() const; :ref:`EigenMatrix` :ref:`trainingCovarianceForTesting`() const; std::size_t :target:`activeEnergyVarianceSolvesForTesting`() const; std::size_t :target:`inverseDiagonalAppendsForTesting`() const; std::size_t :target:`bandInfluenceFactorReusesForTesting`() const; Eigen::VectorXd :target:`trainingInverseDiagonalForTesting`() const; std::size_t :target:`inverseDiagonalBuildsForTesting`() const; void :target:`resetHssvdAppendCountersForTesting`() const; std::size_t :target:`hssvdAppendUpdatesForTesting`() const; void :target:`resetHssvdFactorizationCountersForTesting`() const; std::size_t :target:`hssvdFullFactorizationsForTesting`() const; void :target:`resetFullDataRebuildCountersForTesting`() const; std::size_t :target:`fullDataRebuildsForTesting`() const; Eigen::Index :target:`hssvdBasisObservationCountForTesting`() const; const :ref:`StableBasisND`& :target:`hssvdBasisForTesting`() const; bool :ref:`hssvdEnergyDesign`(const :ref:`FieldMatrixd`& query, Eigen::VectorXd& design, Eigen::VectorXd& coeff) const; double :target:`hssvdBasisConditionNumberForTesting`() const; double :target:`hssvdVarianceCalibrationFactorForTesting`() const; void :target:`setHssvdVarianceCalibrationFactorForTesting`(double factor); void :target:`setOutputScaleForTesting`(double scale); void :target:`scaleTrainingVarianceToPhysical`(Eigen::Ref variance) const; double :target:`totalPosteriorNoiseVarianceForTesting`() const; bool :ref:`hssvdLocalPosteriorCovarianceForTesting`(const :ref:`EigenMatrix`& positions, const :ref:`EigenMatrix`& prior, :ref:`EigenMatrix`& K_post); bool :target:`applyHssvdTrainingRowLatentVarianceForTesting`(const :ref:`EigenMatrix`& positions, Eigen::VectorXd& variance, double total_sigma2) const; void :target:`applyHssvdTrainingRowLatentCovarianceForTesting`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& covariance, double total_sigma2) const; void :target:`setHssvdRetainedSpectrumForTesting`(Eigen::MatrixXd psi, Eigen::VectorXd singular_values); double :target:`reportedVarianceCalibrationFactor`() const; bool :target:`hssvdObjectiveBasisValidForTesting`() const; bool :target:`hssvdObjectiveTraceBasisMaterializedForTesting`() const; Eigen::Index :target:`hssvdObjectivePendingReplicatedEntriesForTesting`() const; double :target:`hssvdObjectiveConditionNumberForTesting`() const; Eigen::Index :target:`hssvdObjectiveRankForTesting`() const; double :target:`hssvdObjectiveTraceInvNoiseForTesting`() const; const :ref:`StructuredPermutation`& :target:`trainingPermutationForTesting`() const; bool :target:`hssvdObjectiveUsesDirectInverseForTesting`() const; bool :target:`hssvdObjectiveTraceViaCholeskyForTesting`() const; void :target:`resetLeaveOneOutObjectiveEvaluationsForTesting`() const; std::size_t :target:`leaveOneOutObjectiveEvaluationsForTesting`() const; void :target:`resetLocalLooObjectiveEvaluationsForTesting`() const; std::size_t :target:`localLooObjectiveEvaluationsForTesting`() const; Eigen::Index :target:`hssvdDualForceWeightRowsForTesting`() const; Eigen::Index :target:`hssvdDualForceWeightColsForTesting`() const; bool :target:`hssvdDualAlphaKPreparedForTesting`() const; void :target:`resetDistributedHssvdDualKernelAssemblyCallsForTesting`() const; std::size_t :target:`distributedHssvdDualKernelAssemblyCallsForTesting`() const; void :target:`resetDistributedHssvdDualKernelFactorizationCallsForTesting`() const; std::size_t :target:`distributedHssvdDualKernelFactorizationCallsForTesting`() const; void :ref:`setDescriptorPredictor`(bool enabled); void :target:`setVarianceConvention`(:ref:`VarianceConvention` convention); :ref:`VarianceConvention` :target:`varianceConvention`() const; const char* :ref:`hyperparameterOptimizationModeName`() const; std::size_t :ref:`lastInlaIterations`() const; void :target:`calculateInlaModeLogBoundsForTesting`(const Eigen::VectorXd& theta_seed, double min_lengthscale, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, Eigen::VectorXd& lower, Eigen::VectorXd& upper) const; double :target:`inlaMinimumLengthScaleForTesting`(double range_x) const; bool :target:`computeInlaPosteriorModeForTesting`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& theta_mode, const :ref:`TrainingKernelGeometry`* training_geom); bool :target:`hssvdDualKernelActiveForTesting`() const; bool :target:`assembleHssvdDualFullCrossCovarianceForTesting`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& Kstar) const; bool :ref:`denseVariancePanelForTesting`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& whitened, Eigen::VectorXd& prior) const; bool :ref:`assembleHssvdDualCrossCovarianceForTesting`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& Kstar, Eigen::VectorXd& prior_diag, bool energy_only) const; bool :target:`assembleHssvdDualTrainingKernelForTesting`(:ref:`EigenMatrix`& kernel) const; Eigen::Index :target:`hssvdLastLocalActiveSetConfigCountForTesting`() const; Eigen::Index :target:`hssvdLastLocalActiveSetObservationCountForTesting`() const; double :target:`hssvdLastLocalActiveSetConditionNumberForTesting`() const; Eigen::Index :target:`hssvdLastLocalPosteriorConfigCountForTesting`() const; Eigen::Index :target:`hssvdLastLocalPosteriorObservationCountForTesting`() const; double :target:`hssvdLastLocalPosteriorConditionNumberForTesting`() const; void :target:`resetDistributedTrainingCovarianceAssemblyCallsForTesting`() const; std::size_t :target:`distributedTrainingCovarianceAssemblyCallsForTesting`() const; void :ref:`calculatePotentialDispatched`(:ref:`Observation`& image1); void :ref:`calculatePotentialBatch`(std::vector<:ref:`Observation`*> queries); void :ref:`calculateVarianceBatch`(std::vector<:ref:`Observation`*> queries); std::uint64_t :ref:`factorEpoch`() const; std::size_t :target:`varianceSolveCacheHitsForTesting`() const; void :ref:`calculateVarianceLaplace`(:ref:`Observation`& image1); void :ref:`calculateVarianceDispatched`(:ref:`Observation`& image1); void :ref:`calculateVarianceHssvd`(:ref:`Observation`& image1); void :ref:`calculateObservationPosteriorCovariance`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& K_post, bool allow_hssvd_local = true); Eigen::VectorXd :ref:`calculateObservationNoiseDiagonal`(const :ref:`EigenMatrix`& positions) const; std::optional<:ref:`JointObservationVarianceReduction`> :ref:`calculateObservationForceVarianceReduction`(const :ref:`EigenMatrix`& positions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance, bool allow_hssvd_local = true); void :ref:`calculateBackgroundObservationPosteriorCrossCovariance`(const :ref:`EigenMatrix`& left, const :ref:`EigenMatrix`& right, :ref:`EigenMatrix`& covariance, const Eigen::VectorXd* mean_weights = nullptr); double :ref:`calculateObservationFunctionalVariance`(const :ref:`EigenMatrix`& positions, const Eigen::VectorXd& weights); bool :ref:`conditionActivePosterior`(const :ref:`Observation`& full_observation, std::shared_ptr`> active_kernel = {}); bool :target:`hasActivePosterior`() const; Eigen::Index :target:`activePosteriorObservationCount`() const; bool :ref:`fitActivePosterior`(const :ref:`Observation`& full_observation, const std::vector& active_lengths, bool compare_cartesian_residual = false); bool :ref:`refreshActivePosterior`(const :ref:`Observation`& full_observation); :ref:`ActivePosteriorRestorePoint` :target:`retainActivePosterior`() const; bool :ref:`restoreActivePosterior`(const :ref:`ActivePosteriorRestorePoint`& point, const :ref:`Observation`& full_observation); std::shared_ptr`> :ref:`makeActiveCovarianceOperator`(const Eigen::VectorXd& theta, const std::vector& active_lengths) const; bool :ref:`trainingFactorAppendable`(Eigen::Index observations) const; std::size_t :ref:`distributedFactorAppendsForTesting`() const; bool :target:`hasBeenOptimized`() const; void :ref:`setJitterSigma2`(double value); double :ref:`getJitterSigma2`() const; void :ref:`setChainImageCount`(int n); void :ref:`setLengthscaleFloor`(double floor); double :target:`getLengthscaleFloor`() const; void :ref:`setParameters`(const :ref:`GPRSetup`& parameters); :ref:`LikGaussian`& :target:`getLikGaussian`(); const :ref:`LikGaussian`& :target:`getLikGaussian`() const; :ref:`SexpatCF`& :target:`getSexpAtCovarianceFunction`(); const :ref:`SexpatCF`& :target:`getSexpAtCovarianceFunction`() const; void :ref:`setInternalCoordinateChart`(std::shared_ptr`> chart, double length_scale); void :ref:`setGeodesicHeatPrior`(std::shared_ptr`> kernel); double :ref:`fitGeodesicHeatPrior`(const :ref:`Coord`& reference_path, const :ref:`Observation`& training_data); void :ref:`clearGeodesicHeatPrior`(); std::optional :ref:`inferInternalCoordinateLengthScale`(const :ref:`geometry::InternalCoordinateChart`& chart) const; double :ref:`getSigma2`() const; double :ref:`getPhysicalTotalDiagonalRegularization`() const; double :ref:`likelihoodNoiseVariance`() const; :ref:`ConstantCF`& :target:`getConstantCovarianceFunction`(); const :ref:`ConstantCF`& :target:`getConstantCovarianceFunction`() const; :ref:`Index_t` :target:`getNumberOfPotentialCalls`() const; const :ref:`EigenMatrix`& :ref:`getL`() const; bool :ref:`hasTrainingCholeskyFactor`(Eigen::Index expected_rows) const; bool :ref:`parkTrainingCholeskyFactor`(); bool :ref:`activateMaterializedPosterior`(); void :ref:`claimActiveTrainingCholeskyFactor`(); const Eigen::VectorXd& :target:`getAlpha`() const; const :ref:`EigenMatrix`& :target:`getRMatrix`() const; const Eigen::VectorXd& :target:`getRIndices`() const; bool :target:`hasTrainingPermutation`() const; :ref:`EigenMatrix` :target:`rowsInTrainingFactorLayout`(const :ref:`EigenMatrix`& input) const; :ref:`EigenMatrix` :target:`symmetricMatrixInTrainingFactorLayout`(const :ref:`EigenMatrix`& input) const; void :ref:`setParameters`(const Eigen::VectorXd& w); Eigen::VectorXd :ref:`packInlaHyperparameters`() const; void :ref:`setHierarchicalPrior`(const Eigen::VectorXd& mu_log, double s2_log); void :ref:`clearHierarchicalPrior`(); bool :ref:`assembleCompositeJointCovariance`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& indices, :ref:`SexpatCF`& covariance, :ref:`EigenMatrix`& result) const; bool :target:`assembleCompositeJointCrossCovariance`(const :ref:`EigenMatrix`& left, const :ref:`EigenMatrix`& right, const Eigen::VectorXd& left_indices, const Eigen::VectorXd& right_indices, :ref:`SexpatCF`& covariance, :ref:`EigenMatrix`& result) const; bool :ref:`assembleCompositeJointCovarianceSecondDerivative`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& indices, :ref:`SexpatCF`& covariance, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& second) const; bool :target:`assembleCompositeJointCovarianceDerivatives`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& indices, :ref:`SexpatCF`& covariance, std::vector<:ref:`EigenMatrix`>& derivatives) const; template void :ref:`accumulateCrossCovarianceMatVecLocal`(const :ref:`EigenMatrix`& x1, const :ref:`EigenMatrix`& x2, const Eigen::VectorXd& ind_Ddim, const Eigen::VectorXd& uDdim, const Eigen::VectorXd& ind_Ddim2, const Eigen::VectorXd& uDdim2, CovFunc& cov_func, const Eigen::VectorXd& weights, Eigen::VectorXd& output, bool do_reduce = true, bool select_prediction_product = false) const; void :ref:`assembleDirectionalCovarianceDerivatives`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& ind_Ddim, const Eigen::VectorXd& uDdim, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& first, :ref:`EigenMatrix`& second, bool serial_per_rank = false) const; bool :target:`assembleDirectionalCovarianceDerivativesFromGeometry`(const :ref:`TrainingKernelGeometry`& geom, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& ind_Ddim, const Eigen::VectorXd& uDdim, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& first, :ref:`EigenMatrix`& second, bool serial_per_rank = false) const; std::optional :ref:`tryPairLocalDirectionalCovariance`(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& indices, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& first, :ref:`EigenMatrix`& second, int rank = 0, int ranks = 1) const; double :target:`evaluateLocalLooGeometryTerm`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, const :ref:`gpr::FieldMatrixd`& geom_dist, Eigen::Index i, Eigen::Index n_geom, Eigen::Index n_blocks, double total_sigma2, Eigen::VectorXd* parameter_gradient = nullptr); double :target:`evaluateLocalNeighborhoodLooObjective`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd* gradient); bool :ref:`failedOptim`() const; std::size_t :ref:`nonfiniteMarginalLikelihoodRejections`() const; bool :ref:`isDecomposedSuccessfully`() const; const :ref:`Observation`& :ref:`fittedObservations`() const; void :ref:`extractCoordinatesByIndex`(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& ind_Ddim, const :ref:`Index_t` ind, :ref:`FieldMatrixd`& x_loc) const; void :ref:`assignBlockToMatrix`(const Eigen::VectorXd& ind_Ddim1, const Eigen::VectorXd& ind_Ddim2, const :ref:`Index_t` row_val, const :ref:`Index_t` col_val, const :ref:`FieldMatrixd`& field, :ref:`EigenMatrix`& matrix, bool transpose_field = false) const; void :ref:`accumulateBlockContribution`(const Eigen::VectorXd& ind_Ddim1, const Eigen::VectorXd& ind_Ddim2, const :ref:`Index_t` row_val, const :ref:`Index_t` col_val, const :ref:`FieldMatrixd`& field, const :ref:`EigenMatrix`& invC, const Eigen::VectorXd& b, double& trace_accum, double& quad_accum, bool transpose_field = false, bool accumulate_quad = true, double diagonal_nugget = 0.0, :ref:`EigenMatrix`* trace_sink = nullptr); double :ref:`traceInverseProduct`(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& observation_order, const detail::RigidDeflationState* deflation_override = nullptr) const; void :ref:`removeColumn`(const :ref:`Index_t` column_ind, :ref:`EigenMatrix`& matrix); :ref:`Index_t` :ref:`getNumberOfRepetitiveIndices`(const Eigen::VectorXd& ind_Ddim) const; virtual void :ref:`calculateVariance`(:ref:`Observation`& image1); bool :ref:`tryGateEnergyVariance`(const :ref:`Observation`& query, Eigen::RowVectorXd& energy_variance); bool :ref:`tryGateEnergyVarianceInterval`(const :ref:`Observation`& query, Eigen::RowVectorXd& energy_variance_lower, Eigen::RowVectorXd& energy_variance_upper); bool :ref:`canCertifyEnergyVarianceInterval`() const; bool :ref:`tryBorderedNoiseReport`(:ref:`BorderedNoiseReport`& report) const; virtual void :ref:`refreshVariancePrefactor`(const Eigen::VectorXd&); virtual double :target:`localVariancePrefactor`(const Eigen::VectorXd&, const Eigen::VectorXd&) const; virtual double :target:`localVariancePrefactorFromQuadratic`(const Eigen::VectorXd&, double) const; bool :ref:`evaluateDirectionalCurvature`(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::VectorXd& direction, double& curvature, const :ref:`TrainingKernelGeometry`* training_geom = nullptr); bool :ref:`evaluateNlmlHessianVector`(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::VectorXd& direction, Eigen::VectorXd& product, const :ref:`TrainingKernelGeometry`* training_geom = nullptr); bool :ref:`assembleExactHessian`(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, int n_hyperparameters, Eigen::MatrixXd& H); bool :ref:`assembleHessianInDirections`(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::MatrixXd& directions, Eigen::MatrixXd& H); bool :ref:`fittedHyperparameterInformation`(Eigen::MatrixXd& information, Eigen::MatrixXd& directions); void :ref:`setRetainFittedHyperparameterDensity`(bool retain); bool :target:`retainsFittedHyperparameterDensity`() const; bool :target:`assembleExactHessianLocalDense`(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, int n_hyperparameters, Eigen::MatrixXd& H); void :target:`updateModelWithFullData`(const :ref:`Observation`& full_observation); void :ref:`updateConfiguration`(const :ref:`AtomsConfiguration`& conf_info); void :ref:`setUsePrecisionMatrix`(bool use); bool :target:`usePrecisionMatrix`() const; const :ref:`AtomsConfiguration`& :target:`getAtomsConfig`() const; void :ref:`calculatePotentialSVGD`(:ref:`Observation`& image1); void :target:`calculateVarianceSVGD`(:ref:`Observation`& image1); void :ref:`calculatePotentialBMA`(:ref:`Observation`& image1); void :target:`calculateVarianceBMA`(:ref:`Observation`& image1); void :ref:`evaluateEnergyAndGradientLocal`(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient); void :ref:`setSVGDConfig`(const :ref:`laplace::SteinVariationalConfig`& cfg); const :ref:`laplace::SteinVariationalConfig`& :target:`getSVGDConfig`() const; }; .. _details-classgpr_1_1_gaussian_process_regression: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; solveTrainingCovarianceInFactorLayout .. _doxid-classgpr_1_1_gaussian_process_regression_1a2b6d888a46175918b0180a7648b0da55: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd solveTrainingCovarianceInFactorLayout(const Eigen::VectorXd& rhs) const Solve the training covariance with RHS and result in factor order. Callers supplying derivative matrices use symmetricMatrixInTrainingFactorLayout. .. index:: pair: function; initialize .. _doxid-classgpr_1_1_gaussian_process_regression_1a8ff665c98467d5435812d4f39a9c109b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initialize(const :ref:`InputParameters`& parameters, const :ref:`AtomsConfiguration`& conf_info) Initialize GPR class. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - conf_info - Information about the configurations necessary for the GPR model * - parameters - Structure of parameters .. index:: pair: function; setModelProfile .. _doxid-classgpr_1_1_gaussian_process_regression_1a898d2482e93f22005a0ca6c8a277707f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setModelProfile(:ref:`GPModelProfile` profile) Select a coherent GP model family. CHEMGP / GPRD_ZBL restore classic joint energy-force configurations as indivisible bundles (dense NLML, raw targets, classic :ref:`Sexpat ` prior). GPRD_ZBL matches the published gpridge dimer path vendored in gprd_zbl; EXTENDED leaves independent knobs alone. .. index:: pair: function; setAtomicEnvironmentModel .. _doxid-classgpr_1_1_gaussian_process_regression_1a5242c1f1952df57a2e2523190e155ae9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAtomicEnvironmentModel(bool enabled) Fit an additive atomic-environment posterior to complete physical energy and Cartesian-gradient observations. Refits optimize the full atomic parameter vector; pair-length active-refit masks do not apply. .. index:: pair: function; restoreAtomicEnvironmentParameterState .. _doxid-classgpr_1_1_gaussian_process_regression_1a4da1117e2becd2ec8fc1ab922ef1d31d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void restoreAtomicEnvironmentParameterState(const :ref:`AtomicEnvironmentParameterState`& state) Restore the atomic parameter domain and invalidate its conditioning. The caller rebuilds the posterior on the observations it retains. .. index:: pair: function; setHyperparameters .. _doxid-classgpr_1_1_gaussian_process_regression_1ad73bb85463cb8e58f4f87708c3a3f2ee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setHyperparameters(const :ref:`Observation`& all_obs, const :ref:`AtomsConfiguration`& conf_info, const bool update_sexpat_cf_param = true, const bool update_const_cf_param = true, const bool update_sqrt_prior_param = true) Set up hyperparameters for GPR. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - all_obs - Structure of all observations * - conf_info - Structure of atoms configuration * - update_sexpat_cf_param - Set to "true" to update parameters of the SexpAt covariance function * - update_const_cf_param - Set to "true" to update parameters of the Constant covariance function * - update_sqrt_prior_param - Set to "true" to update parameters of the SQRT prior .. index:: pair: function; configureModeRefit .. _doxid-classgpr_1_1_gaussian_process_regression_1a99c0b8545b4f9828b9e2dfebe7c8b5d1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool configureModeRefit(const :ref:`Observation`& oracle, const :ref:`Coord`& mode, double force_tolerance, :ref:`ConvergenceNormType` force_norm = :ref:`ConvergenceNormType::L2_NORM`) Restrict one refit using a minimum-mode estimate and an oracle force. Uncertain predictions and measured force errors request the full fit. Error and marginal force RMS use the caller's convergence norm. .. index:: pair: function; configureMinimumModeRefit .. _doxid-classgpr_1_1_gaussian_process_regression_1a5fe6c7825b5caeea10d01e865747191c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool configureMinimumModeRefit(const :ref:`Observation`& oracle, double force_tolerance, :ref:`ConvergenceNormType` force_norm = :ref:`ConvergenceNormType::L2_NORM`, const :ref:`RefitTrustReport`* trust_report = nullptr) Select the active lengths using the lowest eigenvector of the Cartesian mean Hessian at the least trusted acquired observation. Every acquired row must satisfy the force uncertainty and error tolerances; any untrusted row requests a full fit. One Hessian is formed for a trusted batch, at its maximum uncertainty/error witness. The maximum-atom RMS is sqrt(max_a trace(Cov(F_a))). .. index:: pair: function; measuredRowsAgreeWithPosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1adb9e2237ef357ed15e8296beab501741: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MeasuredRowVerdict` measuredRowsAgreeWithPosterior(const :ref:`Observation`& rows, :ref:`ConvergenceNormType` force_norm, double* max_force_error = nullptr, double* max_force_sd = nullptr, double* evidence_nats = nullptr, double variance_calibration = 1.0, :ref:`RefitTrustReport`* trust_report = nullptr) Compare every measured row with the posterior it was drawn against. A row contradicts the posterior when its force error exceeds the posterior force standard deviation at that row (both in the caller's convergence norm): the fitted hyperparameters are then refit. Rows the posterior explains within its own uncertainty leave the hyperparameters in place; conditioning on the rows is what reduces the uncertainty. Unmeasurable when no fitted, decomposed posterior exists or the rows carry no measured forces. ~evidence_nats~, when given, receives the contradiction evidence of the rows: the sum over rows with error e above spread sd of (e/sd)^2/2 - 1/2, in nats. variance_calibration scales the posterior force variance before the comparison: the dimer's own measured calibration of that variance, never below one, so a posterior its trials found overconfident is not contradicted by every row it predicts. .. index:: pair: function; markHyperparametersFitted .. _doxid-classgpr_1_1_gaussian_process_regression_1a6e0dee4587f706245f0dd3409926542b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void markHyperparametersFitted() Fitted hyperparameters installed from outside the optimizer, e.g. a seed kernel handed over by the band that produced the training rows. .. index:: pair: function; setOptimizationRowPool .. _doxid-classgpr_1_1_gaussian_process_regression_1afac1656aae65d7b1cee0bfaa1acd5ddc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setOptimizationRowPool(std::vector pool) Restrict the hyperparameter-optimization subset to the flagged rows of the next :ref:`optimize() ` call; the posterior is still conditioned on every row. An empty pool or a size mismatch selects from all rows. .. index:: pair: function; holdLengthScalesUnresolvedBySubset .. _doxid-classgpr_1_1_gaussian_process_regression_1af1c92beb27c3cc8dd323511223197c31: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector holdLengthScalesUnresolvedBySubset(const :ref:`Observation`& subset) Hold, for the next fit, the length scales a pooled subset does not resolve: its inverse-distance features of that pair type span less than one length scale. Returns the held mask slots. .. index:: pair: function; setOptimizationRequiredRows .. _doxid-classgpr_1_1_gaussian_process_regression_1ac44027d65a5c71793e498faea5c6d226: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setOptimizationRequiredRows(:ref:`Coord` positions) Keep these measured configurations in the hyperparameter subset. Matching rows take precedence over the history pool and FPS choices. A subset grows only when its required rows exceed the history size. .. index:: pair: function; setEnvironmentResiduals .. _doxid-classgpr_1_1_gaussian_process_regression_1ac9aeb702c7c23e58bedcba532ef6526e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setEnvironmentResiduals(bool enabled) Compare pair, SOAP and pair+SOAP corrections on the same conditional observations. SOAP is selected only if NLML and geometry LOO improve. .. index:: pair: function; setAdditivePairResiduals .. _doxid-classgpr_1_1_gaussian_process_regression_1aca7d591f8f99104ede96d6196ed1901c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAdditivePairResiduals(bool enabled) Compare an additive two-body correction, one squared-exponential per chemical pair type on the inverse distance summed over the pairs, alone and on top of the pair correction. Environment refinements share their declared chemical parent in this component. Selected only if NLML and geometry LOO improve. .. index:: pair: function; activeFitStartForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a0a197538652142d9d4f08762d45ba1e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block double activeFitStartForTesting() const MAP objective at the start of the last active correction fit. .. index:: pair: function; activeFitAnchorCountForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a8a0f91a3a6a87cc6be89b67586d923fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index activeFitAnchorCountForTesting() const Anchors the last active correction fit conditioned its candidate objectives on (every anchor when the background has no more rows than its own fit subset). .. index:: pair: function; activeFitSupportCountForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a61b049e57c2e2dc0cdfac633a877ff48: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index activeFitSupportCountForTesting() const Anchors used to condition the selected correction after its support expands beyond the hyperparameter fit subset. .. index:: pair: function; residualInducingCount .. _doxid-classgpr_1_1_gaussian_process_regression_1a46e5f1a01079775c46b5955b4eec8347: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index residualInducingCount() const Configurations carrying the environment residual process in the last residual fit, and how many configurations that fit covered. Equal counts mean the fit was the exact model; a smaller inducing count means the residual prior was the Nystrom projection onto those configurations with each configuration's own block restored, so single-geometry variances stayed exact. .. index:: pair: function; hasPendingResidualModelRefit .. _doxid-classgpr_1_1_gaussian_process_regression_1a49d332c86244a793fd975fabec22a3ed: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hasPendingResidualModelRefit() const Model expansion for a measured error despite small force uncertainty. This does not certify the force or restrict fitting to active lengths. .. index:: pair: function; setUpDefault .. _doxid-classgpr_1_1_gaussian_process_regression_1a20ac68fdd79500edae6cf0f3844c2723: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUpDefault() Set up default parameters. This function allocates memory for the private pointers and calls for :ref:`setUpDefault() ` method on each pointer. .. index:: pair: function; evaluateTrainingCovarianceMatrix .. _doxid-classgpr_1_1_gaussian_process_regression_1af45dab26faec72fae59fd050c74860cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluateTrainingCovarianceMatrix(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool serial_per_rank = false, bool include_constant = true, bool include_noise = true) Evaluate training covariance matrix (gp_cov + noise covariance). The function takes in matrix *x* that contains training input vectors to GPR. Returns the noisy covariance matrix *cov_matrix* for observations y, which is sum of noisless covariance matrix and diagonal term, for example, from Gaussian noise. Every element ij of noisless covariance matrix contains covariance between inputs i and j in *x*. The noisless covariance matrix is formed with all covariance functions. This is essentially the application of the kernel function to the training points .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x - Training input vectors to GP * - x_ind - Per-row observation type or derivative-channel indices * - cov_matrix - Noisy covariance matrix for observations y * - serial_per_rank - Assemble a complete local matrix without a collective reduction * - include_constant - Include the constant covariance component * - include_noise - Add observation noise to the diagonal .. index:: pair: function; fitGeometryFor .. _doxid-classgpr_1_1_gaussian_process_regression_1af64b3636660d7ff0e5045890ef5de52c: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`TrainingKernelGeometry`* fitGeometryFor(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind) const The theta-independent block geometry of the rows a hyperparameter fit evaluates, built on the first objective evaluation of the fit and reused by the rest; nullptr when the rows have no geometry. Keyed on coordinates, observation channels, kernel geometry and execution layout; released when the fit ends. .. index:: pair: function; evaluateActiveCovarianceFromGeometry .. _doxid-classgpr_1_1_gaussian_process_regression_1a5fffbeac430290fa64d4556cb95c3420: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateActiveCovarianceFromGeometry(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, :ref:`EigenMatrix`& covariance, bool serial_per_rank = false, std::vector<:ref:`EigenMatrix`>* covariance_derivatives = nullptr) Latent energy-gradient covariance for an independent active correction. The supplied log parameters use the correction's output units. Inactive length scales have zero inverse-square weight; background parameters, noise and cached posterior factors remain owned by the fitted GP. Optional derivatives contain the log amplitude followed by active log lengths in parameter order; inactive derivative matrices are not formed. .. index:: pair: function; evaluateActiveCovarianceFromGeometry .. _doxid-classgpr_1_1_gaussian_process_regression_1a66bbc5e8171fdc035cacc7dbb6681b6e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateActiveCovarianceFromGeometry(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, :ref:`EigenMatrix`& covariance, bool serial_per_rank, std::vector<:ref:`EigenMatrix`>* covariance_derivatives, const std::vector& derivative_lengths) Select derivative outputs independently of the active covariance's metric. The output contains amplitude followed by requested lengths. .. index:: pair: function; contractActiveCovarianceDerivatives .. _doxid-classgpr_1_1_gaussian_process_regression_1ae02cec232b2205db0e58677571533cc8: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool contractActiveCovarianceDerivatives(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& theta, const std::vector& active_lengths, const :ref:`EigenMatrix`& weight, const std::vector& derivative_lengths, Eigen::VectorXd& contractions, bool serial_per_rank = false) Frobenius products with latent active-kernel parameter derivatives. Returns amplitude followed by the requested log lengths. Block owners reduce scalar products without storing full derivative matrices. .. index:: pair: function; evaluateGradientAfterEnergy .. _doxid-classgpr_1_1_gaussian_process_regression_1ab8de3c090843e8312eee9d39ada15d40: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateGradientAfterEnergy(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& gradient) Gradient at the theta whose factor and kernel ``:ref:`evaluateEnergy ``` just built. A mismatched theta returns false so the caller recomputes both. .. index:: pair: function; evaluateTrainingCovarianceInFactorOrder .. _doxid-classgpr_1_1_gaussian_process_regression_1a23b91a8114eece3b5e51f2e1b884f088: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateTrainingCovarianceInFactorOrder(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, :ref:`EigenMatrix`& cov_matrix, bool include_noise = true) Noisy training covariance, constant excluded, written directly in the factor's observation-tiled order: each pair-local tile entry and each diagonal term lands where permuteSymmetricMatrix would move it, with the same values. False when the rows have no pair-local geometry or no tiled permutation; ``cov_matrix`` is then unspecified. .. index:: pair: function; evaluateTrainingCrossCovarianceInFactorOrder .. _doxid-classgpr_1_1_gaussian_process_regression_1a16dcbc467cf5ab759446cd597fecaeef: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateTrainingCrossCovarianceInFactorOrder(const :ref:`EigenMatrix`& query, const Eigen::VectorXd& query_ind, :ref:`EigenMatrix`& cross) const Training-by-query cross-covariance written directly in the factor's row order: row r of the channel-major assembly lands at training_permutation\_.inv_perm[r] with the same value. False when no permutation is active or the rows are not complete joint observations; ``cross`` is then unspecified. .. index:: pair: function; trainingCrossCovarianceInFactorRows .. _doxid-classgpr_1_1_gaussian_process_regression_1a399fdac8d3f39537ef40509b17b369f7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` trainingCrossCovarianceInFactorRows(const :ref:`EigenMatrix`& query, const Eigen::VectorXd& query_ind, bool serial_per_rank) const The cross-covariance in factor rows, placed when it can be and assembled channel-major and permuted otherwise. .. index:: pair: function; evaluateHyperparameterObjectiveEnergyAndGradient .. _doxid-classgpr_1_1_gaussian_process_regression_1ad75d86dbb3a097f275d81bb57cc6e64a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluateHyperparameterObjectiveEnergyAndGradient(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient) Compute the cached objective-stationarity skip predicate: ||H^{-1} g_new||, where H is an observed-information Hessian at the reference theta and g_new is the augmented-set NLML gradient evaluated at that same theta. Laplace, slice/PSIS, and MAP/SCG Hessian caches can supply H. Returns +infinity when no usable Hessian cache is available. Predicted Newton shift ||H^-1 g_new|| at theta_reference. The optional outputs return the shift vector, the objective and its gradient at theta_reference, so a caller can take the step. Energy and gradient of the objective the hyperparameters are actually fitted on: the leave-one-out objectives (through the training-geometry handle) when they are selected, the marginal likelihood otherwise. The stationarity test that decides whether a refit can be skipped must read this gradient; reading the marginal likelihood's under a LOO fit reported a large shift at every outer iteration and forced a full SCG refit each time. .. index:: pair: function; lastRefitKind .. _doxid-classgpr_1_1_gaussian_process_regression_1a843fb5a29f0c0a853721a665fb33a0b5: .. ref-code-block:: cpp :class: doxyrest-title-code-block int lastRefitKind() const How the last refresh set the hyperparameters: 0 held theta (stationary), 1 took the one Newton step, 2 ran the optimizer. .. index:: pair: function; lastStationarityShift .. _doxid-classgpr_1_1_gaussian_process_regression_1a9e4def020ae47952bdd9bf2382e1d074: .. ref-code-block:: cpp :class: doxyrest-title-code-block double lastStationarityShift() const Last stationarity decision: predicted shift, its threshold, and which curvature model supplied it (0 none, 1 Laplace, 2 Hessian, 3 inverse Hessian, 4 BB scalar, 5 same-objective gradient probe, 6 exact NLML Hessian-vector product under nlml_hessian_vector). .. index:: pair: function; refreshFullDataPosteriorIfObjectiveStationary .. _doxid-classgpr_1_1_gaussian_process_regression_1a2e068c2f63549a92eb9216b26e0f5f9b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refreshFullDataPosteriorIfObjectiveStationary(const :ref:`Observation`& full_observation, double* shift_norm_out = nullptr) Refresh the full-data posterior at fixed theta when the cached objective-stationarity predictor says the MAP shift is smaller than the configured threshold. Returns false when the threshold is disabled, no Hessian cache is available, or the predicted shift is too large. .. index:: pair: function; computeLaplaceSkipScgShiftNorm .. _doxid-classgpr_1_1_gaussian_process_regression_1a5b4a56b4265cf9dfd897b3a5f7f74974: .. ref-code-block:: cpp :class: doxyrest-title-code-block double computeLaplaceSkipScgShiftNorm(const :ref:`EigenMatrix`& opt_R_matrix, const Eigen::VectorXd& opt_R_indices, const Eigen::VectorXd& opt_y) Compatibility wrapper for the Laplace skip-SCG API. Uses the current covariance-function parameter vector as the reference point. .. index:: pair: function; evaluateCovarianceMatrix .. _doxid-classgpr_1_1_gaussian_process_regression_1a1b2a95f93fafbcc6f4d63d533d2913fb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluateCovarianceMatrix(const :ref:`EigenMatrix`& x1, const :ref:`EigenMatrix`& x2, const Eigen::VectorXd& x1_ind, const Eigen::VectorXd& x2_ind, :ref:`EigenMatrix`& C, bool serial_per_rank = false) const Evaluate covariance matrix between two input vectors. Function takes in Gaussian process GP and two matrixes TX and X that contain input vectors to GP. Returns covariance matrix C. Every element ij of C contains covariance between inputs i in TX and j in X. PREDCF is an optional array specifying the indexes of covariance functions, which are used for forming the matrix. If empty or not given, the matrix is formed with all functions. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x1 - First input vector * - x1_ind - :ref:`Observation ` type or derivative-channel indices for rows of x1 * - x2 - Second input vector * - x2_ind - :ref:`Observation ` type or derivative-channel indices for rows of x2 * - C - Covariance matrix * - serial_per_rank - Assemble a complete local matrix without a collective reduction .. index:: pair: function; extractUniqueIndices .. _doxid-classgpr_1_1_gaussian_process_regression_1aaf623460d5dae945b4eb94c849c56c59: .. ref-code-block:: cpp :class: doxyrest-title-code-block void extractUniqueIndices(const Eigen::VectorXd& input_ind, Eigen::VectorXd& output_ind) const Extract unique indices from the input vector. .. index:: pair: function; evaluateEnergyAndGradient .. _doxid-classgpr_1_1_gaussian_process_regression_1a1cced328600b74f24eced4bebd316c7d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluateEnergyAndGradient(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient) Evaluate the energy function (un-normalized negative marginal log posterior) and its gradient. This function takes a Gaussian process structure GP together with a matrix X of input vectors and a matrix Y of targets, and evaluates the energy function E and its gradient G. Each row of X corresponds to one input vector and each row of Y corresponds to one target vector. The energy is minus log posterior cost function: E = EDATA + EPRIOR = - log p(Y|X, th) - log p(th), where th represents the parameters (lengthScale, magnSigma2...), X is inputs and Y is observations (regression) or latent values (non-Gaussian likelihood). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - w - Vector of combined parameters from covariance functions and likelihood * - x - Training input vectors * - x_ind - Per-row observation type or derivative-channel indices * - y - Observed target values aligned with the rows of x * - energy_and_gradient - Output energy and parameter gradient .. index:: pair: function; optimize .. _doxid-classgpr_1_1_gaussian_process_regression_1a5efb3efe500828d20c58cf4e38d56001: .. ref-code-block:: cpp :class: doxyrest-title-code-block void optimize(const :ref:`Observation`& observation) Optimize paramaters of a Gaussian process. This function optimizes the parameters of a GP structure given matrix X of training inputs and vector Y of training targets. .. index:: pair: function; optimizeMarginalLikelihood .. _doxid-classgpr_1_1_gaussian_process_regression_1a06aea732c2986777914354d08d31119f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MarginalLikelihoodReport` optimizeMarginalLikelihood(const :ref:`Observation`& observation) Fit by the Gaussian negative log marginal likelihood alone. The optimizer's MAP prior and barrier penalties are disabled; the positive parameter domain remains part of the covariance definition. .. index:: pair: function; appendFixedHyperparameters .. _doxid-classgpr_1_1_gaussian_process_regression_1ac15072eef909b5ffe9b207efd85a2e51: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool appendFixedHyperparameters(const :ref:`Observation`& full_observation) Append to a fitted posterior at fixed hyperparameters. The existing Cholesky factor must be appendable; otherwise this returns false without rebuilding or optimizing. .. index:: pair: function; calibrateHeldOutForces .. _doxid-classgpr_1_1_gaussian_process_regression_1a82578334308b619859ca000fdb913416: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ForceCalibrationReport` calibrateHeldOutForces(const :ref:`Observation`& held_out, double nominal_probability) Compare held-out true Cartesian gradients with the posterior force marginal. The scale is sqrt(mean(z^2)) for z=(F_true-F_mean)/sd=(G_mean-G_true)/sd and is not clipped or regularized. .. index:: pair: function; calibrateLeaveOneOut .. _doxid-classgpr_1_1_gaussian_process_regression_1a3e2a3f74e09aa93f71e9a530379af597: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`LeaveOneOutCalibrationReport` calibrateLeaveOneOut(double nominal_probability) const Evaluate all training channels by closed-form leave-one-out prediction from the active posterior's inverse diagonal and weights. .. index:: pair: function; setLikelihoodNoiseVariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a0e2da7ec320a78723474d1de2fc0317e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`LikelihoodNoiseVarianceUpdate` setLikelihoodNoiseVariance(double physical_sigma2, const :ref:`Observation`* full_observation = nullptr) Set the likelihood noise variance in physical output units. :ref:`LikGaussian ` stores the converted variance in standardized training-target units. A changed value invalidates noise-dependent model state. When ``full_observation`` is non-null, that state is rebuilt from the supplied observations before this function returns. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - physical_sigma2 - Positive finite variance in physical output units. * - full_observation - Optional full training observation for rebuilding noise-dependent model state. .. rubric:: Returns: Invalid for a rejected value, Unchanged when both representations already match, Updated after invalidation without observations, or Rebuilt after an observation-backed rebuild. .. index:: pair: function; applyLikelihoodNoiseVarianceFloor .. _doxid-classgpr_1_1_gaussian_process_regression_1ae54fe1452a25065551ff3d1eae53955b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool applyLikelihoodNoiseVarianceFloor(double floor_sigma2, const :ref:`Observation`& full_observation) Raise the Gaussian likelihood noise variance to a floor. A valid likelihood variance above the floor is preserved. Its physical mirror is synchronized through setLikelihoodNoiseVariance when needed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - floor_sigma2 - Minimum likelihood variance in physical output sigma^2 units. * - full_observation - Full training observation used to rebuild noise-dependent model state after a change. .. rubric:: Returns: true when this call rebuilt the model state; false when the floor was invalid or no likelihood/mirror change required a rebuild. .. index:: pair: function; evaluatePriorMeanTargets .. _doxid-classgpr_1_1_gaussian_process_regression_1a5b91ae4a764b4cd10466e44bb85f76c3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluatePriorMeanTargets(const Eigen::VectorXd& positions, double& energy, Eigen::VectorXd& gradient) const Prior-mean targets for a virtual (conditioning-only) observation at ~positions~. Fills the energy and gradient of the configured prior mean at the query geometry (zeros when no prior mean is active), so a virtual observation built from them carries an exactly-zero residual under the model's prior-mean subtraction. .. index:: pair: function; optimizeFactorized .. _doxid-classgpr_1_1_gaussian_process_regression_1a475660f8d1dcd1b23d8437e848261e5e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void optimizeFactorized(const :ref:`Observation`& observation) Alternative optimization via eigendecomposition + noise grid search. Assembles the unit signal sexpat kernel without observation noise, eigendecomposes it, then uses :ref:`FactorizedLikelihood ` and :ref:`NoiseGridSearch `. The analytical prefactor is the signal variance. The installed observation noise is that prefactor times the profiled noise to signal ratio. Only works for isotropic lengthscale (single lengthscale for all pairtypes). For ARD, falls back to :ref:`optimize() `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - observation - The full set of observed data. .. index:: pair: function; optimizeChemistryFactorized .. _doxid-classgpr_1_1_gaussian_process_regression_1a262fb153a5b4147997a2c557d23639d1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void optimizeChemistryFactorized(const :ref:`Observation`& observation) Chemistry-constrained ARD refit: pairtype lengthscale ratios fixed from descriptor spreads, global scale on a warm-centered log grid, (prefactor, noise) exact per grid point via the factorized likelihood. A handful of factorizations per refit instead of an SCG trajectory; ratio churn between refits is structurally impossible. Enabled by setChemFactorizedHyperparameters(true); degenerate descriptor scales fall back to the SCG core. .. index:: pair: function; observationBandInfluence .. _doxid-classgpr_1_1_gaussian_process_regression_1a8ff957bdb3a4a3275fd13b79522f4729: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool observationBandInfluence(const :ref:`Observation`& observation, const :ref:`Coord`& band_positions, Eigen::VectorXd& influence, bool collective = false) Per-observation influence on the band posterior. Fills ``influence`` with, for each row of ``observation``, the largest shift its removal would produce in the posterior energy or a Cartesian force at any point of ``band_positions``, computed exactly by the block downdate identity (derivation and verification in scripts/derive_adaptive_pruning_influence.py). Values are in the model's target units, so a caller prunes by comparing against the likelihood noise. Returns false when the model cannot be factored, in which case nothing may be pruned. With collective=true, every process in the model's group participates in factor reuse; a call that cannot reuse the training factor shares the covariance blocks and the scored observations out across the processes, and every process receives the values of a rank-local call. .. index:: pair: function; observationBandInfluence .. _doxid-classgpr_1_1_gaussian_process_regression_1abd016a087d247f47368c08596412806d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool observationBandInfluence(const :ref:`Observation`& observation, const :ref:`Coord`& band_positions, Eigen::VectorXd& influence, bool collective, const std::vector& protected_rows, Eigen::VectorXd* removal_norm = nullptr) Nonzero entries of protected_rows exclude observations from scoring and give them infinite influence. A collective call excludes a row only when every process protects it. An empty mask scores every row. removal_norm, when supplied, receives for every scored observation J the kernel norm of the change its removal makes to the posterior mean, sqrt(alpha_J^T (P_JJ)^{-1} alpha_J) with P = C^{-1}. The reproducing property bounds the change at every geometry x by sqrt(k(x, x)) times that norm, on the band and away from it. .. index:: pair: function; setPhysicsCollocationPath .. _doxid-classgpr_1_1_gaussian_process_regression_1a85a70a4ace6257b25b72e4f35aca7862: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPhysicsCollocationPath(const :ref:`Coord`& path_points) Physics collocation set for hyperparameter selection: the live band (discrete IRC). When nonempty, the chem-factorized grid rejects hyperparameters whose posterior energy profile along these points oscillates (total variation beyond a scale-free multiple of the profile range), a constrained empirical-Bayes filter in the physics-informed-GP sense. Empty clears the filter. .. index:: pair: function; calculatePotential .. _doxid-classgpr_1_1_gaussian_process_regression_1a631fba30036434a316e06bc702bd5659: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotential(:ref:`Observation`& image1) Calculate potential within GPR model. This auxiliary function calculates energy and gradient predictions for given images *R* according to a GPR model. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - image1 - :ref:`Observation ` at image 1 .. index:: pair: function; calculateMeanHessianVectorDispatched .. _doxid-classgpr_1_1_gaussian_process_regression_1a73083b12a3d4066a9317629d4ed7c384: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool calculateMeanHessianVectorDispatched(const :ref:`Coord`& R, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector) Differentiate the physical posterior mean. The HS-SVD product is tried before the exact MAP preparation, which runs only when that product is unavailable. A prepared HS-SVD block that does not apply is a refusal, the same as the dense matrix, and is not replaced by the exact MAP kernel or the fourth-order Cartesian stencil. An exact MAP preparation that is empty or returns false is then a refusal and is not replaced by the stencil. A mean with no analytic contraction still uses the stencil. .. index:: pair: function; calculateLaplaceMixtureMeanHessianVector .. _doxid-classgpr_1_1_gaussian_process_regression_1afe8ec0d01e6727632f1d71c1d1efe8df: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MixtureMeanHessianStatus` calculateLaplaceMixtureMeanHessianVector(const :ref:`Coord`& R, const Eigen::VectorXd& direction, Eigen::VectorXd& hessian_vector) Weighted sum of exact pair-kernel Hessian-vector products at the cached Laplace factors, including the block-assembled mean. NotApplicable when the predictive mean is not that mixture. Refused when the mixture is the mean and a factor contraction fails. .. index:: pair: function; prepareMeanHessian .. _doxid-classgpr_1_1_gaussian_process_regression_1af05cd5ed63c6904bb656c1d86be3542e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MeanHessianAction` prepareMeanHessian(const :ref:`Coord`& R) Linear action of the physical posterior mean at one geometry. The operator is consumed while this fitted model remains unchanged. An exact kernel that returns no action, or an action that returns false, has refused. In a mean with one exact term and one generic term, refusal of the exact term is final. Outside an active posterior, a prepared HS-SVD product is the action before the exact MAP kernel is consulted. A prepared block that does not apply has refused; the exact kernel and the stencil are not substitutes. .. index:: pair: function; calculateMeanHessian .. _doxid-classgpr_1_1_gaussian_process_regression_1a98246d7c7092222527406322549821e0: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool calculateMeanHessian(const :ref:`Coord`& R, Eigen::MatrixXd& hessian) Dense Hessian of the physical posterior mean at one geometry. The sources are tried in this order. An active posterior whose background and residual are both exact assembles their matrices, and a refusal is final. Otherwise, outside an atomic environment or an active posterior, a prepared HS-SVD block applied to the identity is the matrix, before any exact MAP kernel is consulted; a failed apply returns false and leaves the matrix empty, and the action columns and the stencil are not substitutes. When that block is not prepared, the MAP kernel assembles its matrix from its refusal-aware action. A refusal by an exact term is final. A generic term without an analytic contraction is not a refusal: the matrix is then the columns of prepareMeanHessian(R), whose generic miss uses the stencil of the mean gradient. .. index:: pair: function; calculateExactDirectionalCurvature .. _doxid-classgpr_1_1_gaussian_process_regression_1a4a4af41f9baf60cbf5ff904990144289: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool calculateExactDirectionalCurvature(const :ref:`Coord`& R, const Eigen::VectorXd& direction, double& curvature) Directional curvature v^T H_mu(R) v of the posterior mean. True when the contraction is analytic. Exactness is :ref:`KernelOperator::meanCurvature `. A pullback is Exact when its chart provides a directional Jacobian, a conditioned kernel reports its child (so conditioned geodesic heat is Exact), and a sum is Exact only when every summand is. That classification also admits an inverse-distance :ref:`Sexpat ` mean, an exact active-posterior background and residual, and a spectral block. A mean that is not Exact, and an exact operator that refuses the query, returns false and leaves curvature NaN. The predicted-gradient stencil is not a substitute. .. index:: pair: function; prepareAnalyticMeanHessian .. _doxid-classgpr_1_1_gaussian_process_regression_1ab6367064c2d33ce1c1de79d40a8965f8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MeanHessianAction` prepareAnalyticMeanHessian(const :ref:`Coord`& R) The analytic part of prepareMeanHessian. Empty when this model's mean has no analytic Hessian contraction; the returned action never falls back to a stencil of the mean gradient. Unlike prepareMeanHessian it also contracts the Cholesky weights of an HS-SVD model whose stable basis was not built. .. index:: pair: function; calculatePotentialLaplace .. _doxid-classgpr_1_1_gaussian_process_regression_1a68c3462bc272a1219086823075772b4e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialLaplace(:ref:`Observation`& image1) Laplace-mixture-mean potential prediction (INLA, Rue et al. 2009). Equivalent to calculatePotential in API writes into image1.E and image1.G but the predictive mean is the weighted-mixture mean over the CCD grid centred at the current MAP hyperparameters. The posterior factor state is keyed by the training-state stamp; query coordinates do not enter that stamp. Falls back to the standard calculatePotential if any precondition fails (Hessian non-PD, directional oracle refuses, training data absent). Always safe to call. .. index:: pair: function; calculatePotentialLaplaceSlice .. _doxid-classgpr_1_1_gaussian_process_regression_1ac61f88951974030c9938d1d5f9e07d0f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialLaplaceSlice(:ref:`Observation`& image1) Slice-sampling Laplace marginalisation (:ref:`UncertaintyMode ` :: LAPLACE_SLICE). Caches M = slice_laplace_opts\_.n_samples posterior samples (theta_k, alpha_k = K(theta_k)^-1 y) on the first call after a training-data or theta\_\* change, then averages per-sample mean predictions across the cache. No new Cholesky on hot calls; per-call cost is O(M \* n_train \* n_query). Falls back to MAP if the slice burst fails (signature-invalid, NaN initial log-target, kernel state inconsistent). See Murray & Adams 2010 NIPS, arxiv 1006.0868. .. index:: pair: function; calculateVarianceLaplaceSlice .. _doxid-classgpr_1_1_gaussian_process_regression_1a601b0d0c61236bb4215984f1843978d5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateVarianceLaplaceSlice(:ref:`Observation`& image1) Variance counterpart to calculatePotentialLaplaceSlice. Reports the between-sample variance of the per-sample mean predictions (Var_theta[mu(theta; x\*)]); the within-sample variance is left for a follow-up since it requires K^-1 k_cross per sample per query (one extra triangular solve each, doubling per-predict cost). The between-sample variance is the dominant component when the hyperparameter posterior is broad (which is the only regime where LAPLACE differs meaningfully from MAP), so the approximation is fit-for-purpose for the variance-gated acquisition path. .. index:: pair: function; setUncertaintyMode .. _doxid-classgpr_1_1_gaussian_process_regression_1a3007dfc74e619ff2703bd4ec711b6097: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUncertaintyMode(:ref:`UncertaintyMode` mode) Select which predictive path consumers should use. Default MAP matches the pre-Laplace behaviour bit-for-bit; LAPLACE routes through calculatePotentialLaplace (CCD mixture), BMA is reserved for the reference path (not yet wired). .. index:: pair: function; retainHyperparameterPosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1a7e9edb5f1e4447a9e8865e2c347e0d1c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`HyperparameterPosterior` retainHyperparameterPosterior() Materialize and retain the EB/Laplace hyperparameter distribution. Other uncertainty modes return an empty quadrature. .. index:: pair: function; currentHyperparameterPosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1a488a4426621e19e02441b8fed41cca4d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`HyperparameterPosterior` currentHyperparameterPosterior() const Retain an existing, current quadrature without estimating a new one. .. index:: pair: function; conditionOnHyperparameterPosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1a1371dc88cbcae2726a77de3e3945f899: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool conditionOnHyperparameterPosterior(const :ref:`HyperparameterPosterior`& posterior) Condition the quadrature on this model's rows without reweighting its hyperparameters by a likelihood already represented by the source. Requires the same parameter point, output units, noise and pair types. A charted kernel can restore its own quadrature but cannot transfer it to another model. Factors are built on the first integrated prediction. False leaves the current posterior unchanged. .. index:: pair: function; setUseAlphaKPredictMean .. _doxid-classgpr_1_1_gaussian_process_regression_1a587740bdbbc9998426b2504e3967ee36: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUseAlphaKPredictMean(bool use) Enable the alpha-K contraction for MAP mean prediction. .. index:: pair: function; setUseAlphaKLaplaceMean .. _doxid-classgpr_1_1_gaussian_process_regression_1adf9cbe1a569211e6761b4a48304e9966: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUseAlphaKLaplaceMean(bool use) Enable the alpha-K contraction for Laplace-mixture mean prediction. .. index:: pair: function; setFitStepStop .. _doxid-classgpr_1_1_gaussian_process_regression_1a367a5b45ee84736005590110ee99b227: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFitStepStop(bool use) Whether the auto stationarity mode also ends each fit at its scale. .. index:: pair: function; setRigidNullDeflation .. _doxid-classgpr_1_1_gaussian_process_regression_1a813df32c3434a69a3c87c3e8abf4e42b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRigidNullDeflation(bool enabled) Opt-in rigid-motion nullspace deflation for free systems. Default false. When true, projects each free geometry's gradient block onto the orthonormal complement of its rigid motions before Dense or HS-SVD factorization and adds the exact closed-form decoupled noise contribution back to the NLML objective and noise gradient. On free 2-atom Lennard-Jones marginal-likelihood fits, removing the null rigid modes eliminates ~4e-11 rounding drift at step 0 and shifts rgmin SCG+L-BFGS iteration counts (e.g. 28 -> 33, or 38 -> 49 across max_iter=15 restarts). .. index:: pair: function; setMapMeanKernelForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1aa0b1fdee9617e93585c5025ca87581eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setMapMeanKernelForTesting(std::shared_ptr`> kernel) Install the kernel used as the MAP mean expansion. Tests supply an exact operator the fitted covariance cannot express. A null pointer restores the :ref:`Sexpat ` expansion. .. index:: pair: function; setMapMeanKernelOverridesHssvdForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1afd5ee5975937e4a216fe3b747dc517dc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setMapMeanKernelOverridesHssvdForTesting(bool override) Make an installed MAP test kernel take precedence over HS-SVD. .. index:: pair: function; installActivePosteriorHessianActionsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a20d526f5ba1d6b10b3fdd9cb4cc07ee7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool installActivePosteriorHessianActionsForTesting(:ref:`MeanHessianPreparation` background, bool background_exact, :ref:`MeanHessianPreparation` residual, bool residual_exact) Replace the active posterior's Hessian actions for one test. The fitted mean stays in place. A true exact flag makes a false action a refusal of that call only. .. index:: pair: function; setHssvdHessianBlockApplyFailsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a878d89970635da2c94e3e662d800f827: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setHssvdHessianBlockApplyFailsForTesting(bool fail) const Make the dense HS-SVD block apply fail for one test. The vector product is unchanged. The dense assembly treats the failed apply as a final refusal and does not build action columns. .. index:: pair: function; resetDispatchedMapMeanHessianActionsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a7699893c9873fb943263edd2f1f740a5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void resetDispatchedMapMeanHessianActionsForTesting() const Reset the count of exact MAP Hessian actions built by dispatch. .. index:: pair: function; getDispatchedMapMeanHessianActionsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a0800e321445687489c7014bf141cdd11: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t getDispatchedMapMeanHessianActionsForTesting() const Count of exact MAP Hessian actions built by dispatch. .. index:: pair: function; setPriorMeanStatistic .. _doxid-classgpr_1_1_gaussian_process_regression_1a835346686e17a68b0d4179fe03348621: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPriorMeanStatistic(:ref:`PriorMeanStatistic` statistic) The constant the GP reverts to away from its data. The mean of the residual energies lets a surrogate relaxation find lower energy in every direction the training rows never varied (a spectator bond compressed inside one length scale reverts toward a mean that sits below the images near the barrier); the maximum makes every such extrapolation uphill, so the band relaxes where the data supports it and the acquisition measures the boundary. .. index:: pair: function; setOutputScaleFloor .. _doxid-classgpr_1_1_gaussian_process_regression_1a10182b1fc3d6cc55a31728bab53c3ba8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setOutputScaleFloor(bool enabled) Floor the output standardization scale at the energy the gradient data imply. A near-flat energy target has a collapsing standard deviation, and dividing the Cartesian gradient by it amplifies the standardized gradient targets without bound; the fixed standardized noise then stops regularizing them. The floor is sqrt(jitter) \* rms(abs(G_row)) \* rms(abs(R_row - mean R)), an energy built from the gradient scale (eV/A), the spread of the sampled geometries (A) and the model's own relative noise. It raises a collapsing scale only. Default off. .. index:: pair: function; synchronizeOutputTransformFrom .. _doxid-classgpr_1_1_gaussian_process_regression_1a4ccd5e77f309328af0ba7c9c01f0f8a4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void synchronizeOutputTransformFrom(const :ref:`GaussianProcessRegression`& source) Use the same affine output coordinates as another GP. Local and global posteriors that share kernel parameters must also condition on the same residual target E - mean(E). Otherwise changing model ownership changes both the predicted energy and, through the posterior coefficients, its Cartesian gradient. .. index:: pair: function; restoreOutputTransform .. _doxid-classgpr_1_1_gaussian_process_regression_1ad6bdbb4e8c74d87ad7003905588b2068: .. ref-code-block:: cpp :class: doxyrest-title-code-block void restoreOutputTransform(double mean, double scale, bool frozen_mean) Restore output coordinates alongside a kernel represented in them. .. index:: pair: function; setPopulationPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1a922387f93ed3763dc28cb89ddf321632: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPopulationPrior(:ref:`priors::PopulationPrior` prior) The campaign's population prior on the log length scales per element pair (``gpr/prior/PopulationPrior.h``): a pair type the population has seen is anchored at its location with its width, both in the kernel's hierarchical prior and in the MAP anchor. .. index:: pair: function; applyPopulationPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1ad531324aa8d9b4bfd1d5bab4fa9378df: .. ref-code-block:: cpp :class: doxyrest-title-code-block void applyPopulationPrior(const :ref:`AtomsConfiguration`& conf_info, const Eigen::VectorXd& ls_k, double own_s2_log) Anchor the pair types the population has seen in the kernel's prior (log-Gaussian at the population's location and width); ~ls_k~ is the run's own scale per pair type and ~own_s2_log~ the run's own width (zero when it has none). .. index:: pair: function; setUseLogNormalMagnPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1aa92c9d5107f5b5cfa9f81b51138a8b4a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUseLogNormalMagnPrior(bool use) Opt-in log-normal prior on magnSigma2 (:ref:`PriorLogNormal `). Off keeps the half-Student-t or half-Cauchy magnitude prior. .. index:: pair: function; setLengthScaleSeedChemicalFloor .. _doxid-classgpr_1_1_gaussian_process_regression_1abd89284a94cbca9e815f4028382f5951: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLengthScaleSeedChemicalFloor(bool enabled) Floor each pair type's length-scale seed (and the MAP prior anchor rho0) at the covalent-bond descriptor scale 1/r_bond. The measured seed is the pair type's inverse-distance spread over the rows; a spectator pair that barely moves in the first rows gets a spread of 0.003 A^-1 where the fitted value is 0.1-0.3 (a static pair already falls back to the chemical scale, so the floor removes a cliff between "static" and "barely moving"). .. index:: pair: function; setRobustNu .. _doxid-classgpr_1_1_gaussian_process_regression_1a566efb271bad6a5fc37410c8ecd69845: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRobustNu(double nu) Robust rows: the Student-t degrees of freedom of the per- configuration observation model, fitted as a Gaussian scale mixture by one EM sweep per full-data rebuild (0 keeps the Gaussian likelihood). .. index:: pair: function; updateRobustRowWeights .. _doxid-classgpr_1_1_gaussian_process_regression_1a3fe947e7b12a58e02ad8449262d974b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool updateRobustRowWeights(const :ref:`Observation`& full_observation) E-step over the conditioned model: leave-one-geometry-out residuals of every training configuration, their squared Mahalanobis norm, and the extra noise the M-step registers with the likelihood. Returns true when any registered noise changed. .. index:: pair: function; releaseLengthScaleTieForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1af5b28cd5f4b6767e9fe6d3c2e856682f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void releaseLengthScaleTieForTesting(:ref:`Index_t` member) Gives the tie member its own length scale, as the evidence screen does once it has accumulated enough. .. index:: pair: function; lastTieScreenProbes .. _doxid-classgpr_1_1_gaussian_process_regression_1a7df3005556435b5097835fbb3f28068c: .. ref-code-block:: cpp :class: doxyrest-title-code-block int lastTieScreenProbes() const Curvature probes spent by the last length-scale tie screen, whether they were exact NLML Hessian-vector products (nlml_hessian_vector) rather than gradient differences, and the curvature the screen used for each candidate, in candidate order. .. index:: pair: function; lengthScaleTiesActive .. _doxid-classgpr_1_1_gaussian_process_regression_1af963eec26e589627f927ec3fb6362346: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool lengthScaleTiesActive(Eigen::Index length_count) const Whether the packed parameter vector of ``length_count`` log lengths is governed by ties. .. index:: pair: function; tieLengthScaleParameters .. _doxid-classgpr_1_1_gaussian_process_regression_1a0050a5fd702981fba8bdf384295fa81a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tieLengthScaleParameters(Eigen::VectorXd& theta) const Sets every tied member to its leader's log length (theta(1 + t)). .. index:: pair: function; poolDescriptorScaleByTies .. _doxid-classgpr_1_1_gaussian_process_regression_1a0f6ccf9c8d542a6bb484fdf82d2983f3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void poolDescriptorScaleByTies(Eigen::VectorXd& scales) const Pools a per-pair-type motion scale, sqrt of the summed feature variances of the type, over each tie group: every tied member takes the scale of the union of its group's pairs, the base type's own statistic, so a tied model seeds and anchors exactly as the base model does. Released types keep their own scale. .. index:: pair: function; reduceTiedLengthScaleGradient .. _doxid-classgpr_1_1_gaussian_process_regression_1a76aaf05007dd2ffd3fc24a073da718a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void reduceTiedLengthScaleGradient(Eigen::VectorXd& gradient) const J^T g: each leader's gradient entry becomes the sum over its group, the derivative of the objective restricted to the tied subspace, and the held members' entries become zero. .. index:: pair: function; refreshLengthScaleLeaders .. _doxid-classgpr_1_1_gaussian_process_regression_1a63201584fdd3ef0fde01bd0576a75c1a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void refreshLengthScaleLeaders() Recomputes the leaders from the released flags. .. index:: pair: function; setPairLocalTiles .. _doxid-classgpr_1_1_gaussian_process_regression_1a2a3be798a7268f33b192bb9d6eb0f6c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPairLocalTiles(bool enabled) The pair-local tiles assemble the training covariance and contract its hyperparameter derivatives per configuration pair; off, the per-channel block geometry does both. .. index:: pair: function; setPairLocalDirectionalTiles .. _doxid-classgpr_1_1_gaussian_process_regression_1a9f785222bc24f54530bf5255d1f1a5b6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPairLocalDirectionalTiles(bool enabled) Complete energy/gradient layouts assemble directional curvature from pair tiles, including a zero cutoff, with one owner per tile on distributed layouts. The switch follows the pair-local tiles unless set explicitly. Off, curvature rebuilds every channel-pair block. .. index:: pair: function; setUseFFPriorMean .. _doxid-classgpr_1_1_gaussian_process_regression_1a31c153f3865f8ac8d23ad365822b3294: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUseFFPriorMean(bool use) Teng/Bao first-level Morse force-field prior mean. Default off. Mutually exclusive with ZBL at evaluation: Morse wins if both flags are set so the residual is not ZBL+Morse stacked. .. index:: pair: function; setSecantQuadraticPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1a2a5526bde68020300ebc0a1e275f3418: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSecantQuadraticPrior(const Eigen::VectorXd& position, const Eigen::VectorXd& gradient, const Eigen::MatrixXd& hessian, double reference_energy) Quadratic mean carried by an accepted true-force secant. When a ZBL or Morse prior is already active the quadratic is the residual of that prior, and the two add: m(x) = m_prior(x) + q(x). .. index:: pair: function; restoreSecantQuadraticPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1ae87c52a053aa80e717106e11d1f34e83: .. ref-code-block:: cpp :class: doxyrest-title-code-block void restoreSecantQuadraticPrior(const :ref:`SecantQuadraticPriorState`& state) Reinstall a retained quadratic. The use counter is a running tally of what this model evaluated, not part of the quadratic, so it keeps every use made while another quadratic was installed. .. index:: pair: function; physicalPriorMeanActive .. _doxid-classgpr_1_1_gaussian_process_regression_1a4e3c2c6dbf1ab2247040404fed483d22: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool physicalPriorMeanActive() const True when the ZBL or Morse prior mean is the one evaluation uses. .. index:: pair: function; samplePhysicalPriorMean .. _doxid-classgpr_1_1_gaussian_process_regression_1af0fca048f72afc4f786577933d48dc97: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool samplePhysicalPriorMean(const Eigen::VectorXd& position, double& energy, Eigen::VectorXd& gradient) const Exact energy and Cartesian gradient of that prior. False when neither prior is active. .. index:: pair: function; addLayeredPriorHessianAction .. _doxid-classgpr_1_1_gaussian_process_regression_1a0c2446661a0b0c22e4ad393ea7b3fe11: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addLayeredPriorHessianAction(const Eigen::VectorXd& position, const Eigen::VectorXd& direction, Eigen::VectorXd& action) const H_prior(x) v + H_q v, with either term absent when that mean is off. .. index:: pair: function; setUsePsisLaplace .. _doxid-classgpr_1_1_gaussian_process_regression_1a2bfe9acc8f90bde7ae3cd92c572f707d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUsePsisLaplace(bool use) Switch the LAPLACE_SLICE arm between the doubling slice sampler (default, false) and the PSIS-Laplace sampler (Vehtari 2024, arXiv:1507.02646 v9). PSIS-Laplace replaces the slice's M\*~5 Cholesky burst with K Cholesky decomps + a Pareto k_hat reliability check. .. index:: pair: function; setUsePsisDeterministicGrid .. _doxid-classgpr_1_1_gaussian_process_regression_1a429ad8b2737230c11c714ac2e7dd7da2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUsePsisDeterministicGrid(bool use) Switch the PSIS-Laplace sampler between random IS draws (default, false) and a deterministic axial CCD-style grid (true) of K = 1 + 2 p nodes placed at theta_MAP +/- sigma_j e_j on the principal axes of H^{-1}. Deterministic grid is np-reproducible; random IS retains MC variance per rank. Standard INLA Gaussian-mode quadrature (Rue 2009 sec 3.2, GPstuff INLA mode 0). .. index:: pair: function; setUseDeltaMethod .. _doxid-classgpr_1_1_gaussian_process_regression_1a7e24747dedc14069a396f2aa4da6a939: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUseDeltaMethod(bool use) Switch the LAPLACE_SLICE arm to the analytical INLA-Delta variance estimator (Rue 2009 sec 3.2; GPstuff INLA mode 0 'gaussian'). Replaces the per-call sampling/quadrature loop with the closed-form formula: Var[mu(x\*) | y] = Var_MAP(x\*) + g(x\*)^T H^{-1} g(x\*), g(x\*)_j ~= k_cross^T dalpha/dtheta_j. SymPy proof D1-D7 in python/tests/test_sympy_inla_delta.py. Per-call cost O(p N n_q) (no per-call Cholesky); the slice/ PSIS sampling burst is skipped entirely. .. index:: pair: function; setDeltaUHMinDiag .. _doxid-classgpr_1_1_gaussian_process_regression_1ae0c15c80ac84be3d593de7eedd13576a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setDeltaUHMinDiag(double v) DELTA-method robustness knobs. The alpha-K Hessian Laplace correction delta_var(x\*) = g(x\*)^T H^{-1} g(x\*) where H is the NLML Hessian at theta_MAP, blows up when H is ill-conditioned (small min(diag(U_H)) at small training-set size). Observed 1e15-1e17 eV^2 on Baker-NEB 01_hcn outer iters 0 to 8 vs MAP variance of order 1 eV^2; the pure LAPLACE-SLICE arm without DELTA stays bounded. Two complementary guards applied inside calculateVarianceLaplaceSliceDelta: delta_uh_min_diag : skip the correction (delta_var = 0) when min(diag(U_H)) is below this floor. Default 1e-6. Set <= 0 to disable. delta_max_ratio : cap per-query delta_var at this multiple of max(magnSigma2, 1e-12). Default 100.0 (cap corrected std dev at ~10x signal std dev). Set <= 0 to disable. Both default to active; bit-identical to the legacy DELTA path when both are set to 0. .. index:: pair: function; buildRFFModel .. _doxid-classgpr_1_1_gaussian_process_regression_1a29069837eb06c163802947517e9ede78: .. ref-code-block:: cpp :class: doxyrest-title-code-block void buildRFFModel(const :ref:`Observation`& training_data, int D_rff) Random Fourier Features (RFF) layered predict path. Approximates the SE kernel with D_rff random cosine features, then solves Bayesian linear regression in the feature space. Per-call predict cost drops from O(N (D+1)) (cached MAP cross-cov + matvec) to O(D_rff D) (constant in N). Layered ON TOP of the LAPLACE_SLICE + INLA-Delta variance: the RFF mean replaces the cheap-mean MAP path; INLA-Delta still provides the calibrated variance for the gate. D_rff = 0 disables RFF (default; bit-identical to main). .. index:: pair: function; setRFFFeaturesRequested .. _doxid-classgpr_1_1_gaussian_process_regression_1a39420908b736506a0d03a2432c1500eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRFFFeaturesRequested(int D_rff) Configure the layered RFF predict path. D_rff > 0 enables a fixed count and clears automatic selection. :ref:`optimize() ` rebuilds the RFF model on the full observation after each successful SCG fit. 0 disables (default; bit-identical when automatic selection is off). .. index:: pair: function; enableRFFFeatureSelection .. _doxid-classgpr_1_1_gaussian_process_regression_1abae57ed9a2ba3d318e0c4446f77b5f63: .. ref-code-block:: cpp :class: doxyrest-title-code-block void enableRFFFeatureSelection(double force_tol_fraction = 0.0) Opt-in choice of the feature count. ``force_tol_fraction`` of 0 derives the fraction from the deployed gradient noise; any other value must lie in [0, 1). The default stays off, so a model that never calls this keeps the fixed-count path bit-identical. .. index:: pair: function; selectRFFFeatures .. _doxid-classgpr_1_1_gaussian_process_regression_1a37199e7819a26d658e20da1431c522bf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`RFFFeatureSelection` selectRFFFeatures(const :ref:`Observation`& observation, std::uint64_t memory_cap_bytes = :ref:`kRFFValidationMemoryCapBytes`) Choose D on ``observation`` without installing it. The production cap is ``:ref:`kRFFValidationMemoryCapBytes ```. A smaller cap is only a test of the refusal path. .. index:: pair: function; setHyperparameterOptimizationMode .. _doxid-classgpr_1_1_gaussian_process_regression_1a8a7156bb0e7a9836ba8b37f77220f7ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setHyperparameterOptimizationMode(:ref:`HyperparameterOptimizationMode` mode) Explicit mode selection. It outranks the optimization_alg string of any :ref:`InputParameters ` applied later through :ref:`initialize() `, so a profile default cannot silently undo a run's configured mode. .. index:: pair: function; setRgminMethod .. _doxid-classgpr_1_1_gaussian_process_regression_1a9db142f6bc213c98ffb552ee85d49dca: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRgminMethod(rgmin_method_t m) Solver for :ref:`HyperparameterOptimizationMode::RGMIN_OPT `. Applies to the next mode selection as well as the live optimizer, so order of configuration does not matter. .. index:: pair: function; setVarianceSubsetConfigurations .. _doxid-classgpr_1_1_gaussian_process_regression_1a87ae95fbcc0c4e761ec68d29fc2691bd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setVarianceSubsetConfigurations(int configurations) Posterior covariance conditioned on the training configurations nearest the query only (all channels of the ``m`` nearest in the pair-distance metric): the exact posterior of a GP that has seen a subset of the data, an upper bound in the Loewner order on the full posterior, at a cost in m rather than in the training size. Zero keeps the full solve. The subset factor is cached across the queries of one factor epoch that select the same configurations. .. index:: pair: function; setVarianceSubsetFootprint .. _doxid-classgpr_1_1_gaussian_process_regression_1ad3fdb21d618d978338c29036bf5e8e87: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setVarianceSubsetFootprint(bool enabled) The configurations the subset posterior conditions on, chosen by the caller (the search footprint: every configuration the search measured and the seeds within their radius); empty falls back to the nearest-N rule above. The dimer supplies its search footprint as the subset. .. index:: pair: function; setAnnealStage .. _doxid-classgpr_1_1_gaussian_process_regression_1af5a4d0cc78118b1a1163dd08d0ca3e72: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAnnealStage(bool enabled, std::size_t budget, std::size_t replicas, std::size_t every, std::uint64_t seed) The anneal stage before the local MAP fit (``AnnealStage.h``): a box ensemble of ``replicas`` chains with ``budget`` work units, run on the first fit and on every ``every`` -th fit after it. ``enabled`` turns the stage on. A zero ``budget`` spends what the last local fit spent (at least one evaluation per independent, unpinned parameter plus one); a zero ``every`` runs the stage on the first full fit and then only on evidence against the surrogate (a measured force error at or above the force tolerance, or a local fit that did not converge); a positive ``every`` runs it on every such fit regardless. The box half-width is the length-scale prior's scale. A build without the anneal subproject refuses the stage instead of accepting the request and fitting without it. .. index:: pair: function; noteSurrogateContradiction .. _doxid-classgpr_1_1_gaussian_process_regression_1a3d2c2471005ba7bedff1823eca12f2d9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void noteSurrogateContradiction() Evidence against the surrogate at a measured point, the trigger of the next anneal stage under the evidence policy. .. index:: pair: function; lastAnnealStage .. _doxid-classgpr_1_1_gaussian_process_regression_1ae6371f7a60175568f5afb2aaad7752b2: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`AnnealStageSummary`& lastAnnealStage() const The last stage that ran, for diagnostics and tests. .. index:: pair: function; lastFitEvaluationsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a3b1267ed71214b52205d6f4703ff4802: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t lastFitEvaluationsForTesting() const Objective evaluations of the last hyperparameter fit. .. index:: pair: function; rgminWarmStartsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a4050c4c2b31cecf8c4605e85139db2b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t rgminWarmStartsForTesting() const Fits the rgmin sessions opened with the previous fit's record. .. index:: pair: function; rgminWarmPairsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a2b425300aa02e0950beb2a76a8644136: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t rgminWarmPairsForTesting() const Curvature pairs the last rgmin fit transplanted from that record. .. index:: pair: function; setRgminWarmStart .. _doxid-classgpr_1_1_gaussian_process_regression_1ad200ee1b3ef0a1fc0ed775e14603152f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRgminWarmStart(bool keep) Transplant the previous fit's record into the next fit (default true). The record is the accepted steps of the last converged fit as curvature pairs, taken only when the move they propose for the new gradient stays within the opening trust, and dropped when measured rows contradict the posterior (measuredRowsAgreeWithPosterior; :ref:`funcmin::RgminOpt::setPersistentSession `). .. index:: pair: function; forgetRgminSessions .. _doxid-classgpr_1_1_gaussian_process_regression_1ab91c01862c819a12424dccf823558e0d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void forgetRgminSessions() Drop the rgmin sessions' memory: the next fit starts cold. Called when the parameters move to another basin (an anneal stage). .. index:: pair: function; exactNlmlHessianVectorAvailable .. _doxid-classgpr_1_1_gaussian_process_regression_1ae6c8f0db1382632ee912c152ba47afa5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool exactNlmlHessianVectorAvailable() const True when the fitted objective is the Gaussian negative log marginal likelihood that evaluateNlmlHessianVector differentiates. False for leave-one-out objectives, for the residual diagonal correction, whose parameter-dependent shift the product omits, while HS-SVD's Q-form objective is active, for ScaLAPACK (the implementation requires a replicated inverse), and for subclasses that rescale the likelihood (Student-t). .. index:: pair: function; nlmlHessianVectorCurvatureRequested .. _doxid-classgpr_1_1_gaussian_process_regression_1ac827cd8362a55c1c042ce3c522d80d48: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool nlmlHessianVectorCurvatureRequested() const True when curvature_mode is nlml_hessian_vector. SCG curvature, the length-scale tie screen and the stationarity check then take their curvature from evaluateNlmlHessianVector. Where the product is not available or fails, each takes the finite_difference path instead: SCG's gradient probe, the tie screen's gradient differences and the stationarity check's gradient secant. .. index:: pair: function; nlmlHessianVectorFallbacks .. _doxid-classgpr_1_1_gaussian_process_regression_1aeedf0ad11d91c23c27e2a80fb4f9799e: .. ref-code-block:: cpp :class: doxyrest-title-code-block int nlmlHessianVectorFallbacks() const Times this model routed an nlml_hessian_vector request to the finite_difference path (a fit of an objective without the product, a tie screen or a stationarity check), each logged at report level 1. .. index:: pair: function; noteNlmlHessianVectorFallback .. _doxid-classgpr_1_1_gaussian_process_regression_1acf7a8951345d99e809bcce2fc1ca66a1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void noteNlmlHessianVectorFallback(const char* where, const char* why) Counts and logs one such routing: ``where`` took the finite_difference path because of ``why``. .. index:: pair: function; setOptimizationSubsetHistory .. _doxid-classgpr_1_1_gaussian_process_regression_1a0fb3403404bb5c4eee3b38333202d1e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setOptimizationSubsetHistory(int rows) Rows the hyperparameter optimizer fits on: the farthest-point subset of this many rows (plus the latest points) when the training set is larger, the full set otherwise. Nonpositive means every row. The canonical gprd value is 10, adaptively grown to 30 on detected instability; a 300-row band model then had its theta fitted on 10 rows every outer iteration. .. index:: pair: function; setSubsetFailureEscalation .. _doxid-classgpr_1_1_gaussian_process_regression_1a51790add940de41caa94b30c1263f3e8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSubsetFailureEscalation(bool enabled) Policy for a subset fit that does not converge. True (default) refits on every retained row with every length scale active, which swaps the estimator for a different objective. False keeps the subset estimator: the feasible improvement (or the input theta) stands, and the all-rows fit runs only when the subset objective is not evaluable at either point, since the subset then carries no likelihood to optimize. .. index:: pair: function; setRgminInitialLogMove .. _doxid-classgpr_1_1_gaussian_process_regression_1a8a5c1a3e56d034478a5257822564176f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRgminInitialLogMove(double distance) Largest distance, in log-hyperparameter units, the first step of a cold rgmin MAP fit may move the parameters (RgminOpt::setInitialLogMove). Zero leaves the first step to the solver. .. index:: pair: function; setRgminInitialLogMoveWholeSession .. _doxid-classgpr_1_1_gaussian_process_regression_1ac973e603e9f676a80c2ae7071e5af5da: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRgminInitialLogMoveWholeSession(bool whole_session) True (default) lowers the opening step of the whole cold session so its first trial moves at most the bound; false caps the first step only. .. index:: pair: function; setSkipUnchangedSubsetFit .. _doxid-classgpr_1_1_gaussian_process_regression_1ad366abe26881e0447270d74ee1aa8aaa: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSkipUnchangedSubsetFit(bool enabled) Skip a hyperparameter fit whose objective the previous converged fit already minimized. The fitted theta depends on the fit subset and the start only: when an append leaves the selected rows unchanged and the model still holds the theta that fit returned, the fit has nothing to minimize and the new rows are conditioned at that theta. Default off. .. index:: pair: function; unchangedSubsetFitSkipsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a317e1dd524f6a437502efc6d4258d31e: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t unchangedSubsetFitSkipsForTesting() const Fits skipped because the subset and the theta were unchanged. .. index:: pair: function; lastFitConfigurationsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1aff14777de06b48e5801ae0dc13ce79d6: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t lastFitConfigurationsForTesting() const Training configurations in the objective of the last hyperparameter fit (the farthest-point subset, or every row after an escalation). .. index:: pair: function; lastWarmStartInfeasible .. _doxid-classgpr_1_1_gaussian_process_regression_1a0f0b782f7811c1c2f3adbb32b13326e9: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool lastWarmStartInfeasible() const True when the last ~optimize~ started from a theta outside the MAP amplitude barrier of the rows it fitted; such a fit cannot move and the caller should re-seed the hyperparameters. .. index:: pair: function; fittedKernelParameters .. _doxid-classgpr_1_1_gaussian_process_regression_1aab3f24455fc6259c6722871dfb3bf914: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd fittedKernelParameters() const The kernel hyperparameters as the optimizer sees them (log magnitude, log length scales); empty without a kernel. .. index:: pair: function; setWallClockLimit .. _doxid-classgpr_1_1_gaussian_process_regression_1a77ea12e0a0a3d14a36856b9c3dce932d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setWallClockLimit(std::shared_ptr`> limit) Share the enclosing search deadline with every hyperparameter optimizer. A null limit removes the callback. .. index:: pair: function; wallClockLimitReached .. _doxid-classgpr_1_1_gaussian_process_regression_1a5803ef90ca15b13def9187453bcf6128: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool wallClockLimitReached() const Collective on the model's process group for distributed fitters. .. index:: pair: function; setNlmlHessianVectorFailureForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a719a92402c0728c3fc97aebadbf592cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setNlmlHessianVectorFailureForTesting(bool fail) Makes evaluateNlmlHessianVector fail while :ref:`exactNlmlHessianVectorAvailable() ` stays true. .. index:: pair: function; setFitTolerancesForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a96b7e5bdfc8910ac9b0a223797fbff4c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFitTolerancesForTesting(double objective, double step) The fit's objective and step tolerances (the rgmin gradient tolerance is their minimum). .. index:: pair: function; setObjectiveBackend .. _doxid-classgpr_1_1_gaussian_process_regression_1a1938cba13e27f301588c0493d0f497a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setObjectiveBackend(:ref:`ObjectiveBackend` backend, Eigen::Index rank = 0) Select the objective backend. Dense is the default; Auto and Krylov opt into approximate objectives on a dense training covariance. Krylov pivots its preconditioner to ``rank``. .. index:: pair: function; fitStepTolerance .. _doxid-classgpr_1_1_gaussian_process_regression_1a7a7b8ba55972f4d411180a0f16de7146: .. ref-code-block:: cpp :class: doxyrest-title-code-block double fitStepTolerance() const The fit's step tolerance: a hyperparameter shift below it is one the optimizer itself treats as no move. .. index:: pair: function; setRequireScgFallbackImprovement .. _doxid-classgpr_1_1_gaussian_process_regression_1a7075f02021ae539a72fab72188ecb2e9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRequireScgFallbackImprovement(bool enabled) A dimer search sets this so an L-BFGS recovery that does not lower the MAP objective is discarded and the SCG point is kept. A flat ridge otherwise moves the hyperparameters without a better fit. .. index:: pair: function; lastFitRestarts .. _doxid-classgpr_1_1_gaussian_process_regression_1ada2b7e20df2f1713948fb7cbc44cfd50: .. ref-code-block:: cpp :class: doxyrest-title-code-block int lastFitRestarts() const Restarts of the last fit; only a marginal-likelihood fit restarts. .. index:: pair: function; scaleLaplaceFactorForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a3bb215ff5f58bd44a65291e47f341e74: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool scaleLaplaceFactorForTesting(std::size_t index, double scale) Multiplies the Cholesky factor of Laplace factor ``index`` by ``scale`` on the rank that owns it, building the posterior first. A scale far below 1 inflates the whitened cross covariance, so the stable variance of that factor is negative and is refused. Returns whether this rank owned and rescaled the factor. .. index:: pair: function; disableLaplaceFactorsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1aaeda62bb32caf7714eb4fd6345f70f6d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool disableLaplaceFactorsForTesting() Build the Laplace posterior if needed and mark every factor unusable, so that a mixture Hessian finds no factor to contract. False when no posterior can be built. .. index:: pair: function; invalidateTrainingFactorCache .. _doxid-classgpr_1_1_gaussian_process_regression_1a78fa8066fe58756226efc123b5337987: .. ref-code-block:: cpp :class: doxyrest-title-code-block void invalidateTrainingFactorCache() Drop any cached training covariance factor without altering fitted hyperparameters or output normalization, forcing the next conditioning call to build a full Cholesky factor. .. index:: pair: function; devicePosteriorLiveForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a154f2c0cd9abcbd4597819ab81671c7a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool devicePosteriorLiveForTesting() const True while the resident device posterior holds the training factor. The host C, L and a are then empty until a reader materializes them. .. index:: pair: function; residentTrainingFactorRetainedForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1afcebada3f778402568c6e6644dd37baa: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool residentTrainingFactorRetainedForTesting() const True while a :ref:`Kokkos ` copy of the training factor is retained beside L. Host execution memory keeps the single :ref:`Eigen ` factor and leaves this false. Device memory retains the copy. .. index:: pair: function; devicePosteriorCapableForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a289645098ad07e56c7789a8e1f1a30ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool devicePosteriorCapableForTesting() const True when conditioning or an objective evaluation takes the device posterior, so host assembly counters and caches stay untouched. .. index:: pair: function; trainingCovarianceForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1aa6fba1f6f41a05707002b2449ba9d5cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` trainingCovarianceForTesting() const The training covariance C. Under a resident device posterior the host matrix is not kept; L L^T of the downloaded factor stands in and reproduces C to the rounding of the factorization. .. index:: pair: function; hssvdEnergyDesign .. _doxid-classgpr_1_1_gaussian_process_regression_1adf5546f2aa4745a40fbbc9328b157804: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hssvdEnergyDesign(const :ref:`FieldMatrixd`& query, Eigen::VectorXd& design, Eigen::VectorXd& coeff) const Design row and reduced coefficients of one HS-SVD energy prediction. The standardized energy is their dot product. .. index:: pair: function; hssvdLocalPosteriorCovarianceForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1ad787a03051615c5008d5ed2895abcda1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hssvdLocalPosteriorCovarianceForTesting(const :ref:`EigenMatrix`& positions, const :ref:`EigenMatrix`& prior, :ref:`EigenMatrix`& K_post) The local HS-SVD posterior covariance of ``positions`` against a caller-supplied prior block, as calculateObservationPosteriorCovariance reaches it, so a test can pose a prior the model never forms. .. index:: pair: function; setDescriptorPredictor .. _doxid-classgpr_1_1_gaussian_process_regression_1a906a2dd616bdbce53e1e86f55c7eda00: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setDescriptorPredictor(bool enabled) Predict the mean through the inverse-distance descriptor form of the kernel on every backend. The descriptor form is a reparametrisation of the :ref:`Sexpat ` kernel (their predictions agree to rounding), and its per-row cost is O(n_feat \* dof) against the O((1+dof)^2 \* n_pairs) Cartesian joint-block assembly. .. index:: pair: function; hyperparameterOptimizationModeName .. _doxid-classgpr_1_1_gaussian_process_regression_1afc5bdaf0b2078272fa5ca981e3cd5485: .. ref-code-block:: cpp :class: doxyrest-title-code-block const char* hyperparameterOptimizationModeName() const Name of the hyperparameter fit in force, for the run report. .. index:: pair: function; lastInlaIterations .. _doxid-classgpr_1_1_gaussian_process_regression_1a0546afba83e5cbedd9e34cad4e09f0b4: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t lastInlaIterations() const Newton (RFO) iterations taken by the most recent INLA mode search. .. index:: pair: function; denseVariancePanelForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a0195458d2acb98e06bc7a6ba0c101b2e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool denseVariancePanelForTesting(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& whitened, Eigen::VectorXd& prior) const The whitened panel L^{-1} K(X, x\*) and prior diagonal that the dense Cholesky marginal variance of ``positions`` reduces, built by the same assembly and triangular solve as calculateVariance. .. rubric:: Returns: False without a dense training factor. .. index:: pair: function; assembleHssvdDualCrossCovarianceForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a5fc38a87de4b26b6fce20f2e0cb0ed4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool assembleHssvdDualCrossCovarianceForTesting(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& Kstar, Eigen::VectorXd& prior_diag, bool energy_only) const The dual-kernel cross covariance and prior diagonal that the HS-SVD variance routes contract; ``energy_only`` selects the energy columns the energy gate reads. .. index:: pair: function; calculatePotentialDispatched .. _doxid-classgpr_1_1_gaussian_process_regression_1aacab4d7b71123f8e62b8a7dadb96bbee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialDispatched(:ref:`Observation`& image1) Dispatched predict: routes to calculatePotential (MAP) or calculatePotentialLaplace based on uncertainty_mode\_. This is what AtomicDimer / GPNEB should call; the explicit non-dispatched methods stay available for direct use (e.g. tests). .. index:: pair: function; calculatePotentialBatch .. _doxid-classgpr_1_1_gaussian_process_regression_1a8a771b4c3e5281bc64e6c3620632a96c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialBatch(std::vector<:ref:`Observation`*> queries) One dispatched mean predict for B same-composition queries. Stacks the query rows, assembles one cross-covariance, writes each query's energy and gradient. Empty or mixed-D lists are a no-op. Sequential calculatePotentialDispatched on the same queries must match. .. index:: pair: function; calculateVarianceBatch .. _doxid-classgpr_1_1_gaussian_process_regression_1a552de130ab513e74f216eb6784deb527: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateVarianceBatch(std::vector<:ref:`Observation`*> queries) One dispatched variance predict for B same-composition queries. .. index:: pair: function; factorEpoch .. _doxid-classgpr_1_1_gaussian_process_regression_1aa952632ed042aaea392d21bbb4503860: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::uint64_t factorEpoch() const Monotone generation of the fitted posterior. Both full-data fits and conditioning on new observations advance the generation. .. index:: pair: function; calculateVarianceLaplace .. _doxid-classgpr_1_1_gaussian_process_regression_1a060ba78a1861bb543817b4e7e9135517: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateVarianceLaplace(:ref:`Observation`& image1) Laplace-mixture predictive variance (law of total variance over the CCD grid centred at theta\*). Same shape contract as calculateVariance: writes per-test-point variance into image1.E (N_im scalars) and per-dim gradient variance into image1.G (N_im x D). Falls back to calculateVariance (MAP) if no Laplace fit can be built. .. index:: pair: function; calculateVarianceDispatched .. _doxid-classgpr_1_1_gaussian_process_regression_1a44c0df3dad05c05b412fa76a07c91136: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateVarianceDispatched(:ref:`Observation`& image1) Dispatched variance: calculateVariance (MAP) or calculateVarianceLaplace based on uncertainty_mode\_. Dimer certificate consumers call this when both energy and force variance are required. .. index:: pair: function; calculateVarianceHssvd .. _doxid-classgpr_1_1_gaussian_process_regression_1a6085651f6051b3cc0b15597ca3eabed5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateVarianceHssvd(:ref:`Observation`& image1) Stable-basis posterior energy variance, consistent with the HS-SVD mean. var(x\*) = k(x\*,x\*) - k\*^T (K+sigma2 I)^{-1} k\* via the eigen-form; inflates to magnSigma2 where x\* leaves the training data, fixing the over-confidence of routing the mean through the stable basis while the variance still came from the Laplace/Cholesky path. Writes energy variance into image1.E (calculateVariance convention). Requires the serial factorize (A_train retained); callers fall back otherwise. .. index:: pair: function; calculateObservationPosteriorCovariance .. _doxid-classgpr_1_1_gaussian_process_regression_1aadf8fa87438e29a84bfca67276e08a0f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateObservationPosteriorCovariance(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& K_post, bool allow_hssvd_local = true) Compute the latent joint posterior covariance of energy and gradient channels at query positions in physical output units. Channel order matches :ref:`Observation ` : energies for every query, followed by each gradient column. .. index:: pair: function; calculateObservationNoiseDiagonal .. _doxid-classgpr_1_1_gaussian_process_regression_1af0fa8d0ba58ba2bceb75b56f236ee3dd: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd calculateObservationNoiseDiagonal(const :ref:`EigenMatrix`& positions) const Physical Gaussian measurement variance, including jitter, in the joint energy-gradient channel order used for sequential conditioning. .. index:: pair: function; calculateObservationForceVarianceReduction .. _doxid-classgpr_1_1_gaussian_process_regression_1ae0f8523950e44b084e61fd16b5bf7b41: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`JointObservationVarianceReduction`> calculateObservationForceVarianceReduction(const :ref:`EigenMatrix`& positions, Eigen::Index candidate_query, const std::vector& target_queries, double noise_variance, bool allow_hssvd_local = true) Force-variance reduction from a complete energy-gradient query. Active residuals evaluate one target geometry at a time, preserving the full posterior and the background's joint query subset. .. index:: pair: function; calculateBackgroundObservationPosteriorCrossCovariance .. _doxid-classgpr_1_1_gaussian_process_regression_1aabfd6c294ebc0ee937cff2afcb2eb132: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateBackgroundObservationPosteriorCrossCovariance(const :ref:`EigenMatrix`& left, const :ref:`EigenMatrix`& right, :ref:`EigenMatrix`& covariance, const Eigen::VectorXd* mean_weights = nullptr) Posterior cross covariance of the joint channels of ``left`` against ``right``, or its contraction with ``mean_weights``; public for the tests of the subset-conditioned posterior. .. index:: pair: function; calculateObservationFunctionalVariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a2aad602efbb380de050e8c2bbb84f94d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double calculateObservationFunctionalVariance(const :ref:`EigenMatrix`& positions, const Eigen::VectorXd& weights) Latent variance of a linear energy-gradient observation in physical units. Weights use the joint channel order above. A configured variance subset matches the joint covariance; otherwise contraction precedes the global posterior solve. Reporting noise and calibration are absent. .. index:: pair: function; conditionActivePosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1ae0d0fe92abea0a35332bddf513f7201c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool conditionActivePosterior(const :ref:`Observation`& full_observation, std::shared_ptr`> active_kernel = {}) Condition the fitted full GP plus an independent active kernel on the appended rows of a cumulative observation history. The full-fit prefix must match exactly. Each call conditions on that suffix once, using the same frozen background. A null kernel gives sequential conditioning. Kernel outputs use physical energy-gradient covariance units. .. index:: pair: function; fitActivePosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1aa908cde1f62582354106f9f574237eda: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool fitActivePosterior(const :ref:`Observation`& full_observation, const std::vector& active_lengths, bool compare_cartesian_residual = false) Optimize an independent correction on the appended observations using the conditional likelihood and the configured MAP priors. The fitted background and its output transform remain fixed. False requests a full refit when the correction cannot reach stationarity. .. index:: pair: function; refreshActivePosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1a59c0b2a96b561133c53775779bd53e01: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refreshActivePosterior(const :ref:`Observation`& full_observation) Condition the fixed active kernel on an extended observation suffix. Returns false when a full fit must replace the retained background. .. index:: pair: function; restoreActivePosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1ae2edc35282f476adeecefdd2572570d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool restoreActivePosterior(const :ref:`ActivePosteriorRestorePoint`& point, const :ref:`Observation`& full_observation) Recondition the retained correction after restoring its background parameters and output coordinates. False denotes an empty restore point; incompatible ownership, coordinates, or observations throw. .. index:: pair: function; makeActiveCovarianceOperator .. _doxid-classgpr_1_1_gaussian_process_regression_1abd26aafff3b9c27ddb61b27106a2aeef: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::shared_ptr`> makeActiveCovarianceOperator(const Eigen::VectorXd& theta, const std::vector& active_lengths) const Own a fixed pair-kernel snapshot with zero metric weights for inactive lengths. Theta contains log signal variance in physical output units, followed by log descriptor lengths in the full pair-type order. .. index:: pair: function; trainingFactorAppendable .. _doxid-classgpr_1_1_gaussian_process_regression_1abb8fedd8c9f9056930b9b8be5d5f8518: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingFactorAppendable(Eigen::Index observations) const Has a full or conditional hyperparameter fit been accepted? Trust decisions require a fitted posterior with calibrated parameters. True when a full-data rebuild on ~observations~ configurations would append to the cached distributed factor instead of refactorizing: the factor is live, the design grows, and the kernel parameters are those it was built with. .. index:: pair: function; distributedFactorAppendsForTesting .. _doxid-classgpr_1_1_gaussian_process_regression_1a3ed075118e18b0f02f5756a39ca6ff59: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t distributedFactorAppendsForTesting() const Rebuilds that appended to the cached distributed factor. .. index:: pair: function; setJitterSigma2 .. _doxid-classgpr_1_1_gaussian_process_regression_1a440703b59211e161ae096962f23d44ad: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setJitterSigma2(double value) Set sigma2 jitter value. .. index:: pair: function; getJitterSigma2 .. _doxid-classgpr_1_1_gaussian_process_regression_1a81f44bb2c5d88baebbd003310c755706: .. ref-code-block:: cpp :class: doxyrest-title-code-block double getJitterSigma2() const Configured numerical diagonal jitter variance. .. index:: pair: function; setChainImageCount .. _doxid-classgpr_1_1_gaussian_process_regression_1af6a5cbcc04d8cfa7c73d216de466ad64: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setChainImageCount(int n) Set the NEB chain image count so :ref:`optimize() ` can apply image-count-adaptive length-scale controls where configured. .. index:: pair: function; setLengthscaleFloor .. _doxid-classgpr_1_1_gaussian_process_regression_1ac0f1c50a8250a6ad9972ca0ced9c5e95: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLengthscaleFloor(double floor) Absolute kernel length-scale floor for the MAP projection domain. Callers set it to the finest PES structure their sampling stencil resolves (the dimer sets its finite-difference stencil diameter); 0 disables the floor. .. index:: pair: function; setParameters .. _doxid-classgpr_1_1_gaussian_process_regression_1a21f1e919a31d5c29cd7b893bded6a5e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setParameters(const :ref:`GPRSetup`& parameters) Set parameters of the GPR model. .. index:: pair: function; setInternalCoordinateChart .. _doxid-classgpr_1_1_gaussian_process_regression_1a3f3e46900936d4648b7cde08e7effbd1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setInternalCoordinateChart(std::shared_ptr`> chart, double length_scale) Configure this regression as a fixed-chart local molecular GP. The ordinary dense joint energy-gradient posterior remains active, while feature paths specialized to inverse-distance :ref:`Sexpat ` geometry are disabled. Local chart models inherit or set their scalar kernel parameters and condition without a separate hyperparameter optimizer. .. index:: pair: function; setGeodesicHeatPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1a1e7572b85565f21da49a60158e85396c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setGeodesicHeatPrior(std::shared_ptr`> kernel) Attach a fitted heat component and select its exact execution paths. The component retains its own reference geometry and pair metric. .. index:: pair: function; fitGeodesicHeatPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1a76c9d2572f5c4dc469ae482449f573f7: .. ref-code-block:: cpp :class: doxyrest-title-code-block double fitGeodesicHeatPrior(const :ref:`Coord`& reference_path, const :ref:`Observation`& training_data) Fit the nonnegative amplitude of an additive geodesic heat covariance against the current noisy base GP by exact joint energy-gradient marginal likelihood, including its configured diagonal nugget. The base can be inverse-distance :ref:`Sexpat ` or a chart pullback; a zero optimum retains that base covariance. .. index:: pair: function; clearGeodesicHeatPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1aeff08beb0296fb76919b1360131b8e5c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void clearGeodesicHeatPrior() Remove the additive geodesic covariance and restore the configured base-kernel execution backend for hyperparameter fitting. .. index:: pair: function; inferInternalCoordinateLengthScale .. _doxid-classgpr_1_1_gaussian_process_regression_1ac5b0f27f8f19b56bc40ae728bb53a747: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional inferInternalCoordinateLengthScale(const :ref:`geometry::InternalCoordinateChart`& chart) const Match one isotropic intrinsic length to the fitted global kernel's mean force variance in a nonredundant molecular tangent space. Returns no value when the chart or projected force metric is not positive and finite. .. index:: pair: function; getSigma2 .. _doxid-classgpr_1_1_gaussian_process_regression_1a06216b0a3c0ce84eb01dc3f6e58f782d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double getSigma2() const Live physical output-noise variance of the fitted model (the value the resolution-limit admission threshold and RFF path consume). .. index:: pair: function; getPhysicalTotalDiagonalRegularization .. _doxid-classgpr_1_1_gaussian_process_regression_1a6fbdcfa9ed3a9a4e52f4542649b07258: .. ref-code-block:: cpp :class: doxyrest-title-code-block double getPhysicalTotalDiagonalRegularization() const Physical diagonal regularisation of the training covariance: the Gaussian likelihood variance plus the numerical jitter, both mapped to the physical output frame. The posterior variance of a trained row is bounded by this total, so a force-readiness ceiling built from :ref:`getSigma2() ` alone sits below the variance a fully resolved band can reach whenever the jitter is not negligible. .. index:: pair: function; likelihoodNoiseVariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a38e105f3290b95616cf627906a7dd409: .. ref-code-block:: cpp :class: doxyrest-title-code-block double likelihoodNoiseVariance() const Fitted Gaussian likelihood noise variance sigma_n^2. This is the restricted-variance acquisition floor, not the SE signal scale :ref:`SexpatCF::getMagnSigma2() `. .. index:: pair: function; getL .. _doxid-classgpr_1_1_gaussian_process_regression_1a3ea5f8002000a75f17ed205fb9425610: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`EigenMatrix`& getL() const Read-only accessors for training-state members consumed by downstream Laplace / TCOV-INLA helpers. .. index:: pair: function; hasTrainingCholeskyFactor .. _doxid-classgpr_1_1_gaussian_process_regression_1ae9592dc5e174c1f7fd190b5ff6bce6c2: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hasTrainingCholeskyFactor(Eigen::Index expected_rows) const A usable training Cholesky factor exists for the :ref:`linalg::forward_solve ` / back_solve consumers: either the dense member L matches the training rows, or (ScaLAPACK backend) the factor lives replicated-distributed in the DistributedState cache and is owned by this model. The scalapack cholesky() caches the factor and empties the dense member, and every triangular solve consults the cache first, so an empty dense L with a matching cache is fully functional; guards that compare :ref:`getL() `.rows() against the training size bail on exactly that valid state. .. index:: pair: function; parkTrainingCholeskyFactor .. _doxid-classgpr_1_1_gaussian_process_regression_1ad18a1af509b8efedba4de2a8f4dd704c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool parkTrainingCholeskyFactor() Move this model's distributed training factor out of the process-wide ScaLAPACK solve slot while another GP owns it. .. index:: pair: function; activateMaterializedPosterior .. _doxid-classgpr_1_1_gaussian_process_regression_1aa94e816a1e1b2b74602c451803e52298: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool activateMaterializedPosterior() Reactivate a materialized posterior without rebuilding its joint energy-gradient covariance. :ref:`Eigen ` factors and HS-SVD posteriors are already object-local; ScaLAPACK factors are restored into its solve slot. .. index:: pair: function; claimActiveTrainingCholeskyFactor .. _doxid-classgpr_1_1_gaussian_process_regression_1a2686fbc9f6977a651afed9e3038e7a5c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void claimActiveTrainingCholeskyFactor() Associate the live ScaLAPACK factor with this GP after a materialize. .. index:: pair: function; setParameters .. _doxid-classgpr_1_1_gaussian_process_regression_1aa21f4f7384b1e63d38a372bbd906c608: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setParameters(const Eigen::VectorXd& w) Set GP parameters. This function sets parameters in the covariance functions *sexpat* and *constant* and in the Gaussian likelyhood *lik_gaussian*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - w - Vector of combined parameters from covariance functions and likelyhood. Used by callers (e.g. OCINEB) that snapshot then restore theta around a sibling phase that would otherwise drift it. .. index:: pair: function; packInlaHyperparameters .. _doxid-classgpr_1_1_gaussian_process_regression_1a94ea430fb79d230c9bfafb9bf3c5341b: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd packInlaHyperparameters() const Pack the current hyperparameters into the same flat vector layout consumed by ~setParameters~. The trailing log(sigma_n^2) likelihood-noise coordinate is included only when the active theta owns that coordinate. Inverse of ~setParameters~; suitable for snapshot / restore. .. index:: pair: function; setHierarchicalPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1a82c3fc4d42859efee6aa4f26b006bf51: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setHierarchicalPrior(const Eigen::VectorXd& mu_log, double s2_log) Activate a hierarchical-Bayes Gaussian prior on this GP's SExp kernel log-parameters: ~log(theta) ~ N(mu_log, s2_log \* I)~. The packed layout of ~mu_log~ matches ~packInlaHyperparameters()~ ~[log(magnSigma2), log(lengthScale[0]), ..., log(lengthScale[K-1])]~ plus an active trailing ~log(sigma_n^2)~ likelihood-noise coordinate when present. The next ~optimize~ call adds this prior's contribution to the SCG NLML objective; setting ~mu_log~ to the session GP's MAP turns the per-image SCG into a posterior shrinkage estimator that pulls noisy small-N per-image fits back toward the global anchor. Forward to the SExp covariance function; the constant kernel (which has no learnable hyperparameter) is unaffected. .. index:: pair: function; clearHierarchicalPrior .. _doxid-classgpr_1_1_gaussian_process_regression_1aa233d890b7200dc92908ac305ecba9a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void clearHierarchicalPrior() Disable the hierarchical prior set via ~setHierarchicalPrior~. Restores the flat prior path on the SExp kernel. .. index:: pair: function; assembleCompositeJointCovariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a9ec67b12b12644ee0799d3dca50465fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool assembleCompositeJointCovariance(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& indices, :ref:`SexpatCF`& covariance, :ref:`EigenMatrix`& result) const Derivative tensors dC/dtheta_j of the composite joint covariance under a manifold chart, ordered as :ref:`SexpatCF::combineParameters ` (log magnSigma2, then log lengthScale entries; only entry (0,0) enters the chart kernel). .. index:: pair: function; assembleCompositeJointCovarianceSecondDerivative .. _doxid-classgpr_1_1_gaussian_process_regression_1a71be661bcf731741fccc3e9829a68c29: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool assembleCompositeJointCovarianceSecondDerivative(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& indices, :ref:`SexpatCF`& covariance, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& second) const Second directional derivative of the charted joint covariance along a hyperparameter direction p = (p_u, p_v, ...) in the combineParameters order (log magnitude, log length scale): C_pp = p_u^2 K + 2 p_u p_v K_v + p_v^2 K_vv, since the log-magnitude derivative of every block is the block itself. .. index:: pair: function; accumulateCrossCovarianceMatVecLocal .. _doxid-classgpr_1_1_gaussian_process_regression_1a7acfeadfcccdc4809e391db765ddd965: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void accumulateCrossCovarianceMatVecLocal(const :ref:`EigenMatrix`& x1, const :ref:`EigenMatrix`& x2, const Eigen::VectorXd& ind_Ddim, const Eigen::VectorXd& uDdim, const Eigen::VectorXd& ind_Ddim2, const Eigen::VectorXd& uDdim2, CovFunc& cov_func, const Eigen::VectorXd& weights, Eigen::VectorXd& output, bool do_reduce = true, bool select_prediction_product = false) const Accumulate local K(x1, x2)^T \* weights contributions without materializing the full cross-covariance matrix. This follows the same block ownership scheme as applyCrossCovarianceFunction() but contracts each owned block directly against the relevant segment of *weights*. Public so numerical-equivalence tests can call it via a helper free function without friend gymnastics; those tests gate alpha-K changes on bit-equivalence vs the dense KK^T \* alpha reference. .. index:: pair: function; assembleDirectionalCovarianceDerivatives .. _doxid-classgpr_1_1_gaussian_process_regression_1adc5142dba4e55bf9b2e3d35026b48612: .. ref-code-block:: cpp :class: doxyrest-title-code-block void assembleDirectionalCovarianceDerivatives(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& ind_Ddim, const Eigen::VectorXd& uDdim, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& first, :ref:`EigenMatrix`& second, bool serial_per_rank = false) const Assemble the directional first and second derivatives of the training covariance matrix for the optimized :ref:`Sexpat ` parameters. Public + const so that out-of-class callers (e.g. :ref:`laplace::TCovSecondOrder `) can request directional kernel derivatives without needing friend access; promoted from private for that purpose. .. index:: pair: function; tryPairLocalDirectionalCovariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a2ba5801f20f58a8b241da0a99bd30138: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional tryPairLocalDirectionalCovariance(const :ref:`TrainingKernelGeometry`& geom, const Eigen::VectorXd& indices, const Eigen::VectorXd& direction, :ref:`EigenMatrix`& first, :ref:`EigenMatrix`& second, int rank = 0, int ranks = 1) const nullopt selects the per-channel representation. A returned false rejects invalid data; true supplies the owned bare kernel derivatives. .. index:: pair: function; failedOptim .. _doxid-classgpr_1_1_gaussian_process_regression_1a18c556c924b1f741811752d975198b6b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool failedOptim() const True after the most recent :ref:`optimize() ` / :ref:`optimizeFactorized() ` call failed to converge. Set by the SCG / Ceres / INLA paths and inspected by the dimer's monitorAndAdaptHyperparameters loop. .. index:: pair: function; nonfiniteMarginalLikelihoodRejections .. _doxid-classgpr_1_1_gaussian_process_regression_1a88e0970efdece8f467fe118c2312d859: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t nonfiniteMarginalLikelihoodRejections() const Lifetime count of refits that kept the input theta because the marginal likelihood there was non-finite. The stop reason names the same event. .. index:: pair: function; isDecomposedSuccessfully .. _doxid-classgpr_1_1_gaussian_process_regression_1a815a26736ff85e0c20e75b83928d0354: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isDecomposedSuccessfully() const True after the most recent covariance factorization succeeded. Dest INLA lives in a free helper, so it cannot read the protected flag. .. index:: pair: function; fittedObservations .. _doxid-classgpr_1_1_gaussian_process_regression_1a05fca0328d4c19f70ac8b8d96eb79cf1: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Observation`& fittedObservations() const The observations the current posterior is fitted on. .. index:: pair: function; extractCoordinatesByIndex .. _doxid-classgpr_1_1_gaussian_process_regression_1aaaff5a8d0673a37bb49e4f7bcf98b90a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void extractCoordinatesByIndex(const :ref:`EigenMatrix`& x, const Eigen::VectorXd& ind_Ddim, const :ref:`Index_t` ind, :ref:`FieldMatrixd`& x_loc) const Extract coordinates from *x* using value *ind* from *ind_Ddim*. .. note:: Exploits the contiguous block structure of ind_Ddim (blocks of N_im identical indices) to perform a single block copy from row ind\*N_im instead of scanning all rows. x_loc must be pre-sized to the correct number of rows. .. index:: pair: function; assignBlockToMatrix .. _doxid-classgpr_1_1_gaussian_process_regression_1a3a4a6d1d5518eb04eadff7563d8a3257: .. ref-code-block:: cpp :class: doxyrest-title-code-block void assignBlockToMatrix(const Eigen::VectorXd& ind_Ddim1, const Eigen::VectorXd& ind_Ddim2, const :ref:`Index_t` row_val, const :ref:`Index_t` col_val, const :ref:`FieldMatrixd`& field, :ref:`EigenMatrix`& matrix, bool transpose_field = false) const Assign *field* to *matrix* according to indices form *ind_Ddim1* and *ind_Ddim2*. This function performs the following operation (in MATLAB form): .. math:: matrix(ind_Ddim == row_val, ind_Ddim == col_val) = field; .. note:: *matrix* should be pre-allocated .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ind_Ddim1 - Vector of dimensions used in rows * - ind_Ddim2 - Vector of dimensions used in columns * - row_val - Index of row * - col_val - Index of column * - field - Reference field * - matrix - Reference matrix * - transpose_field - True if the field should be transposed .. index:: pair: function; accumulateBlockContribution .. _doxid-classgpr_1_1_gaussian_process_regression_1a8bf749ee1ca92df2c886c66877338c15: .. ref-code-block:: cpp :class: doxyrest-title-code-block void accumulateBlockContribution(const Eigen::VectorXd& ind_Ddim1, const Eigen::VectorXd& ind_Ddim2, const :ref:`Index_t` row_val, const :ref:`Index_t` col_val, const :ref:`FieldMatrixd`& field, const :ref:`EigenMatrix`& invC, const Eigen::VectorXd& b, double& trace_accum, double& quad_accum, bool transpose_field = false, bool accumulate_quad = true, double diagonal_nugget = 0.0, :ref:`EigenMatrix`* trace_sink = nullptr) Accumulate trace and quadratic-form contributions from one block. Adds the contribution of the logical block matrix(ind_Ddim1 == row_val, ind_Ddim2 == col_val) = field to trace_accum += tr(invC \* dK_block) quad_accum += b^T dK_block b without materializing the full dK matrix. Hutchinson option: when ``trace_probe_W`` and ``trace_probe_Z`` are supplied (both N x m), the trace term is accumulated as the un-normalized stochastic estimator sum_j (W_block.col(j))^T dK_block (Z_block.col(j)) instead of the exact tr(invC \* dK_block). Summed over all blocks this gives sum_j w_j^T dK z_j; the caller divides the per-hyperparameter accumulator by m to obtain the Hutchinson estimate of tr(K^-1 dK) when w_j = K^-1 z_j. The quadratic (alpha / alpha-K) term is identical in both modes only the trace term changes so the estimator never perturbs the data-fit gradient. .. index:: pair: function; traceInverseProduct .. _doxid-classgpr_1_1_gaussian_process_regression_1aaab9b439d0063c10a38a2946f5fe3370: .. ref-code-block:: cpp :class: doxyrest-title-code-block double traceInverseProduct(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& observation_order, const detail::RigidDeflationState* deflation_override = nullptr) const tr(K^{-1} A) through the training factor. A is in observation order. .. index:: pair: function; removeColumn .. _doxid-classgpr_1_1_gaussian_process_regression_1a389f5fd8c51115a7f271041adaa4f498: .. ref-code-block:: cpp :class: doxyrest-title-code-block void removeColumn(const :ref:`Index_t` column_ind, :ref:`EigenMatrix`& matrix) Remove column from the dense matrix. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - column_ind - Column index * - matrix - Dense matrix .. index:: pair: function; getNumberOfRepetitiveIndices .. _doxid-classgpr_1_1_gaussian_process_regression_1ae0854385eab73ce53757694cb346e6d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Index_t` getNumberOfRepetitiveIndices(const Eigen::VectorXd& ind_Ddim) const Count number of the first repetitive indices in *ind_Ddim*. .. index:: pair: function; calculateVariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a03b32a06f67d213d1d477d6edd1ecb43: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void calculateVariance(:ref:`Observation`& image1) Compute predictive variance for energy and gradient. Corresponds to MATLAB get_variance.m. .. index:: pair: function; tryGateEnergyVariance .. _doxid-classgpr_1_1_gaussian_process_regression_1a11d5d4b7bd096bceeeb0a9a94f5fdf3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tryGateEnergyVariance(const :ref:`Observation`& query, Eigen::RowVectorXd& energy_variance) Energy-channel posterior variance from a cached factorization. Assembles only the energy (index-0) query block, so the cross-covariance is n_atoms columns rather than n_atoms\*(D+1). That is the cheap Pmat the ActiveGP force() gate needs: if this returns false the caller must use calculateVariance (exact Amat). Distributed-only ScaLAPACK L is refused so the path never issues a collective to answer a point query. HS-SVD uses the cached basis and applies the same LOO calibration factor as calculateVarianceHssvd. .. index:: pair: function; tryGateEnergyVarianceInterval .. _doxid-classgpr_1_1_gaussian_process_regression_1af42a4ff7a01778c0bfb31b3950e27590: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tryGateEnergyVarianceInterval(const :ref:`Observation`& query, Eigen::RowVectorXd& energy_variance_lower, Eigen::RowVectorXd& energy_variance_upper) Two-sided certified Schur energy-variance intervals [lower, upper] from the exact-kernel HS-SVD MAP bordered factor. The noise is the one the trained factor inverts (condition-floored, as for the mean). A negative lower endpoint is clamped to zero when the upper endpoint is nonnegative. Returns false when the model lacks the exact kernel; throws std::domain_error when M cannot be certified positive definite or the upper endpoint is negative. .. index:: pair: function; canCertifyEnergyVarianceInterval .. _doxid-classgpr_1_1_gaussian_process_regression_1ab295f08a7d649911ab546c2cbbf5f224: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool canCertifyEnergyVarianceInterval() const Whether tryGateEnergyVarianceInterval can certify this model: an exact-kernel HS-SVD MAP posterior with no replacement path active. .. index:: pair: function; tryBorderedNoiseReport .. _doxid-classgpr_1_1_gaussian_process_regression_1a49468b214b2abe8658e73f6acd22781a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tryBorderedNoiseReport(:ref:`BorderedNoiseReport`& report) const The noise the trained factor conditions on (likelihood variance plus jitter, condition-floored), the certificate gap eps_k - lambda_min_cert of the exact-kernel factor, and the noise the interval certifies. Returns false when the interval is unsupported; throws std::runtime_error when the factor cannot be built. .. index:: pair: function; refreshVariancePrefactor .. _doxid-classgpr_1_1_gaussian_process_regression_1a3ba0139339793ffaf9331b74ef7b268f: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void refreshVariancePrefactor(const Eigen::VectorXd&) Hook called inside calculateVarianceLaplace at each CCD grid point, right after calculateMeanPrediction (so b := L^{-1} y is valid) and before calculateVariance(scratch_var). Purpose: let subclasses refresh any hyperparameter-dependent cached scalar that their override of calculateVariance consumes. Default: no-op. :ref:`StudentTProcessRegression ` overrides this to recompute tp_prefactor\_ = (2 hp_b + S) / (2 hp_a + n - 2) per grid point so the mixture variance reflects the TP's full hyperparameter posterior (the MAP prefactor is stale at every off-centre CCD point). .. index:: pair: function; evaluateDirectionalCurvature .. _doxid-classgpr_1_1_gaussian_process_regression_1a5d10bfe574c60232a5b87c475048c4e1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateDirectionalCurvature(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::VectorXd& direction, double& curvature, const :ref:`TrainingKernelGeometry`* training_geom = nullptr) Evaluate the exact directional curvature p^T H p for the current GP objective state. Returns false when the current kernel parametrization cannot supply a backend-local exact directional derivative path, in which case callers should fall back to the finite-difference probe. .. index:: pair: function; evaluateNlmlHessianVector .. _doxid-classgpr_1_1_gaussian_process_regression_1a779caac93a05f4aa2563def4dd423c72: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool evaluateNlmlHessianVector(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::VectorXd& direction, Eigen::VectorXd& product, const :ref:`TrainingKernelGeometry`* training_geom = nullptr) Exact Hessian-vector product of the negative log marginal likelihood, including the covariance-function prior. H v = d/deps grad NLML(theta + eps v) at eps = 0. The data term is contracted from the cached inverse, alpha = K^{-1} y, and the kernel derivatives already used by the analytic gradient. beta = K^{-1}(D alpha) is the only new triangular solve. The MAP penalty is not included. Returns false when :ref:`exactNlmlHessianVectorAvailable() ` is false, for a missing factor, an HS-SVD Q-form objective, or a failed derivative assembly. The nlml_hessian_vector curvature mode then takes the finite_difference path, logged and counted. .. index:: pair: function; assembleExactHessian .. _doxid-classgpr_1_1_gaussian_process_regression_1a6bba6340b1c0a3d2d28994401969df03: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool assembleExactHessian(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, int n_hyperparameters, Eigen::MatrixXd& H) Assemble the full p x p observed-information Hessian of the negative log marginal likelihood at the current hyperparameters. Uses the evaluateDirectionalCurvature oracle plus the polarisation identity validated symbolically in python/tests/test_sympy_laplace.py::test_polarisation_identity_recovers_off_diagonal: H(i,i) = e_i^T H e_i (p direct calls) H(i,j) = ( (e_i+e_j)^T H (e_i+e_j) * e_i^T H e_i * e_j^T H e_j ) / 2 (p(p-1)/2 extra calls) Total: p(p+1)/2 directional oracle calls, each of which reuses the cached Cholesky factor L and alpha. Symmetrised on the way out. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x_ind - unique-index vector (same semantics as evaluateDirectionalCurvature). * - x - training input matrix. * - y - training targets. * - n_hyperparameters - p length of the hyperparameter vector the directional oracle is parameterised by (the direction argument to evaluateDirectionalCurvature has this length). * - H - [out] p x p observed Hessian. Resized to (p, p) on successful return. .. rubric:: Returns: true if the oracle returned a finite curvature at every probe direction. false on any failure; H is left NaN. .. index:: pair: function; assembleHessianInDirections .. _doxid-classgpr_1_1_gaussian_process_regression_1ac2d38da9629484c1354ad64c70a742a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool assembleHessianInDirections(const Eigen::VectorXd& x_ind, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& y, const Eigen::MatrixXd& directions, Eigen::MatrixXd& H) Assemble J^T H J directly from the columns of J, without probing directions excluded by the parameter constraints. .. index:: pair: function; fittedHyperparameterInformation .. _doxid-classgpr_1_1_gaussian_process_regression_1a37d068b4180305dc73feae7b232731bf: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool fittedHyperparameterInformation(Eigen::MatrixXd& information, Eigen::MatrixXd& directions) Observed information of the retained fitting density in its free log coordinates. Includes the selected MAP penalty and intrinsic kernel priors, on the actual fit rows and target scale. The columns of directions map these coordinates to packed kernel/noise parameters. Returns false without a supported interior fit snapshot. Uses a separate numerical workspace and preserves the live posterior factor. .. index:: pair: function; setRetainFittedHyperparameterDensity .. _doxid-classgpr_1_1_gaussian_process_regression_1a87a96a4a2dc58cbd8a93550f3fe3c19a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRetainFittedHyperparameterDensity(bool retain) Keep a snapshot of the fitted density after each hyperparameter fit so fittedHyperparameterInformation can describe it. Off by default: a fit then copies no rows, targets or kernel and leaves the distance cache and the slice-Laplace state untouched. .. index:: pair: function; updateConfiguration .. _doxid-classgpr_1_1_gaussian_process_regression_1ac405d0a8d8fe0a20295b1d1d74af1125: .. ref-code-block:: cpp :class: doxyrest-title-code-block void updateConfiguration(const :ref:`AtomsConfiguration`& conf_info) Update the internal atoms configuration. Use this when the set of active/frozen atoms changes dynamically. .. index:: pair: function; setUsePrecisionMatrix .. _doxid-classgpr_1_1_gaussian_process_regression_1a37c61e2eb719df5184bccd1a895f7272: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setUsePrecisionMatrix(bool use) Select explicit precision algebra for the direct Cholesky posterior. Posterior means materialize the inverse from the active factor at each use. Posterior variances solve against that factor and do not form it. The inverse is dense and is not retained across objective or posterior changes. .. index:: pair: function; calculatePotentialSVGD .. _doxid-classgpr_1_1_gaussian_process_regression_1a074990631302a7a94136b5721641141a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialSVGD(:ref:`Observation`& image1) SVGD particle posterior predict + variance. Routed via calculatePotentialDispatched / calculateVarianceDispatched when uncertainty-mode=svgd. .. index:: pair: function; calculatePotentialBMA .. _doxid-classgpr_1_1_gaussian_process_regression_1aec5b598ed87849ea291e3acdf8c1454e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotentialBMA(:ref:`Observation`& image1) Bayesian Model Averaging gold-standard reference predict and variance. Marginalises the predictive distribution over a 2D log10 grid (lengthScale x noise_var) weighted by the posterior p(theta_k | D) ~ exp(-NLML(theta_k)). Routed via calculatePotentialDispatched / calculateVarianceDispatched when uncertainty-mode=bma. The grid is fitted from scratch on each call (no cache); per-call cost is n_grid noiseless Cholesky decompositions, intentionally heavier than LAPLACE since BMA is the validation reference for the LAPLACE mixture. .. index:: pair: function; evaluateEnergyAndGradientLocal .. _doxid-classgpr_1_1_gaussian_process_regression_1a802d28d16c7ac806ee56606762287914: .. ref-code-block:: cpp :class: doxyrest-title-code-block void evaluateEnergyAndGradientLocal(const Eigen::VectorXd& w, const :ref:`EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, :ref:`EnergyAndGradient`& energy_and_gradient) Local-only counterpart to evaluateEnergyAndGradient: every linear algebra step uses :ref:`Eigen ` LLT on the rank's local heap rather than the ScaLAPACK collective Cholesky. Required by callers that want to evaluate the GP NLML at many hyperparameter samples in parallel across MPI ranks (each rank holds a different theta); a collective inside that loop would either deadlock or feed different matrices into the same global call. Mutates rank-local kernel state via setParameters(w) the same way the distributed evaluator does; pair with ScopedKernelState at the call-site if the caller needs to restore (magn, ls, sigma2) after a sweep. Does NOT touch member L, b, a, or C (the distributed Cholesky state); writes only into the caller-supplied energy_and_gradient out parameter. .. index:: pair: function; setSVGDConfig .. _doxid-classgpr_1_1_gaussian_process_regression_1a33a2270b76ef2194120c591ecc62d517: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSVGDConfig(const :ref:`laplace::SteinVariationalConfig`& cfg) SVGD config getters/setters. Default-constructed SteinVariationalConfig matches the prior hardcoded literals (T=30, eps=0.05, conv_tol=1e-3) so existing callers stay bit-identical until they opt in.