.. index:: pair: struct; gpr::neb::ActiveLearningSession .. _doxid-structgpr_1_1neb_1_1_active_learning_session: struct gpr::neb::ActiveLearningSession ====================================== .. toctree:: :hidden: struct_gpr_neb_ActiveLearningSession_ImageModel.rst struct_gpr_neb_ActiveLearningSession_IndexedObservation.rst struct_gpr_neb_ActiveLearningSession_LocalKernelSeed.rst struct_gpr_neb_ActiveLearningSession_SecantReplaySample.rst struct_gpr_neb_ActiveLearningSession_SurrogateFingerprint.rst class_gpr_neb_ActiveLearningSession_ModelLease.rst class_gpr_neb_ActiveLearningSession_PolicyScope.rst Overview ~~~~~~~~ Shared GP + training data state for an active-learning saddle search session. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct ActiveLearningSession { // typedefs typedef std::function`&, const :ref:`AtomsConfiguration`&, const :ref:`Observation`&)> :target:`AfterInitialise`; // structs struct :ref:`ImageModel`; struct :ref:`IndexedObservation`; struct :ref:`LocalKernelSeed`; struct :ref:`SecantReplaySample`; struct :ref:`SurrogateFingerprint`; // classes class :ref:`ModelLease`; class :ref:`PolicyScope`; // fields :ref:`gpr::Observation` :ref:`training_obs`; :ref:`gpr::Observation` :ref:`virtual_obs`; std::vector :ref:`virtual_retire_radii`; double :ref:`virtual_obs_noise_sigma2` = 0.04; bool :ref:`ci_active_at_outer_start` = false; int :ref:`ci_stable_outer_count` = 0; bool :ref:`stagnation_handoff` = false; double :ref:`last_max_chain_energy_variance` = std::numeric_limits::quiet_NaN(); std::vector<:ref:`IndexedObservation`> :ref:`current_chain_certificates`; :ref:`gpr::GaussianProcessRegression` :ref:`gp`; std::vector<:ref:`ImageModel`> :ref:`image_models`; int :ref:`min_per_image_n_train` = 3; int :ref:`per_image_knn` = 10; double :ref:`per_image_prior_s2_log` = 0.1; :ref:`gpr::AtomsConfiguration` :ref:`atoms_config`; :ref:`gpr::InputParameters` :ref:`input_parameters`; std::function`&, :ref:`gpr::AtomsConfiguration`&)> :ref:`gp_setup`; double :ref:`path_energy_ceiling` = std::numeric_limits::infinity(); bool :ref:`initialised` = false; bool :target:`resolution_dedup_enabled_` = false; long :target:`resolution_dedup_rejected_` = 0; :ref:`EndpointSymmetry` :target:`endpoint_symmetry_`; long :target:`symmetry_rows_admitted_` = 0; long :target:`symmetry_rows_rejected_` = 0; std::vector :ref:`training_multiplicity`; // methods static int :target:`selectMmfModelOwner`(bool dimer_use_global_gp, bool image_model_eligible, int image_idx); static bool :target:`integratesHyperparameters`(const :ref:`gpr::GaussianProcessRegression`& model); void :ref:`setSecantHessianConfig`(const :ref:`optim::SecantHessianConfig`& config); template bool :ref:`purchaseSecantConsistencyProbe`(Measure&& measure); const :ref:`optim::SecantHessian`& :target:`globalSecantHessian`() const; const :ref:`optim::SecantHessian`* :target:`imageSecantHessian`(int image_idx) const; void :ref:`noteTrueForceSecant`(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient); std::size_t :ref:`secantReplaySize`() const; std::size_t :ref:`secantReplayTrainingRows`() const; bool :ref:`secantReplayHoldsTrainingRow`(const Eigen::VectorXd& position) const; :ref:`optim::SecantCurvatureCounts` :target:`secantCounts`() const; void :ref:`addSecantCounts`(const :ref:`optim::SecantCurvatureCounts`& extra); :ref:`SharedParameterState` :target:`sharedParameterState`() const; bool :target:`sharesGlobalHyperparameters`(const :ref:`gpr::GaussianProcessRegression`& model) const; std::uint64_t :target:`imageModelSurrogateRevision`(int image_idx) const; std::uint64_t :target:`trainingRevision`() const; std::uint64_t :target:`globalModelSurrogateRevision`() const; :ref:`SurrogateFingerprint` :target:`surrogateFingerprint`(int owner) const; int :target:`mmfModelOwner`(int image_idx, bool dimer_use_global_gp) const; :ref:`SurrogateFingerprint` :target:`mmfSurrogateFingerprint`(int image_idx, bool dimer_use_global_gp) const; void :ref:`setLikelihoodNoiseFloorRms`(const double* noise_rms); void :ref:`setRefitTrainingRevisions`(std::uint64_t revisions); std::uint64_t :target:`refitTrainingRevisions`() const; std::uint64_t :ref:`surfaceEpoch`() const; void :ref:`refreshLikelihoodNoiseFloor`(); void :ref:`initialise`(); bool :ref:`applySeededModel`(); void :ref:`setAfterInitialise`(:ref:`AfterInitialise` hook); int :ref:`priorObservations`() const; void :target:`notePriorObservations`(int count); void :target:`noteLocalKernelSeed`(double signal_variance, double length_scale); const :ref:`LocalKernelSeed`& :target:`localKernelSeed`() const; void :ref:`noteExternalHyperparameterFit`(); bool :ref:`updateFrozenEnvironment`(const :ref:`gpr::Coord`& band); void :ref:`initializePerImage`(int n_images); int :ref:`boundActiveSetToBand`(const :ref:`gpr::Coord`& band_positions, Eigen::Index max_rows); double :ref:`observationResolutionFloor`() const; double :ref:`nearestTrainingDistance`(const Eigen::VectorXd& positions) const; void :ref:`appendObservation`(const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`); void :ref:`setEndpointSymmetry`(:ref:`EndpointSymmetry` symmetry); const :ref:`EndpointSymmetry`& :target:`endpointSymmetry`() const; long :ref:`symmetryRowsAdmitted`() const; long :target:`symmetryRowsRejected`() const; void :ref:`setResolutionDedup`(bool on); bool :ref:`withinTrainingResolution`(const Eigen::VectorXd& positions) const; long :target:`resolutionDedupRejected`() const; int :ref:`admitObservation`(const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`); void :ref:`appendSymmetryImage`(int source_row, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient); void :ref:`syncTrainingMultiplicity`(); void :ref:`noteExternalTrainingEdit`(); void :target:`markCurrentTrainingRevisionRetainedByPolicy`(const :ref:`policy::TrainingPolicy`* policy); bool :ref:`retainTrainingRowsForPolicy`(const :ref:`policy::TrainingPolicy`& policy); bool :ref:`addVirtualObservation`(const Eigen::VectorXd& positions, double retire_radius); void :ref:`retireVirtualObservationsNear`(const Eigen::VectorXd& positions); void :ref:`syncVirtualNoiseTag`(); :ref:`gpr::Observation` :ref:`composedTrainingObs`() const; void :ref:`appendObservation`(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`); bool :ref:`attachImageObservation`(int image_idx, int global_row_index); void :ref:`appendCurrentChainObservation`(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`); void :target:`recordCurrentChainCertificate`(int image_idx, const Eigen::VectorXd& positions); void :target:`recordCurrentChainCertificate`(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient); bool :target:`currentChainCertificateMatchesGeometry`(int image_idx, const Eigen::VectorXd& positions) const; std::optional<:ref:`IndexedObservation`> :target:`currentChainObservation`(int image_idx, const Eigen::VectorXd& positions) const; bool :target:`hasCurrentChainCertificate`(int image_idx, const Eigen::VectorXd& positions) const; void :ref:`setImageNeighborhood`(int i, const std::vector& emd_indices, const Eigen::VectorXd* image_position = nullptr); std::vector :ref:`selectArchivedNeighbors`(const std::vector& kept, const Eigen::VectorXd* image_position, Eigen::Index D); bool :ref:`setImageInternalCoordinateChart`(int i, std::shared_ptr`> chart); bool :ref:`setGlobalInternalCoordinateChart`(std::shared_ptr`> chart); void :target:`clearGlobalInternalCoordinateChart`(); const std::shared_ptr`>& :target:`globalInternalCoordinateChart`() const; double :target:`globalInternalCoordinateLengthScale`() const; bool :ref:`setBandGeodesicReferencePath`(const :ref:`gpr::Coord`& reference_path); bool :ref:`setImageGeodesicReferencePath`(int i, const :ref:`gpr::Coord`& reference_path); bool :ref:`refitImageGP`(int i); void :ref:`ensureSingletonForGlobal`(); bool :ref:`ensureSingletonForImage`(int i); void :target:`markModelMaterialized`(int owner, const Eigen::VectorXd& theta, const :ref:`SharedParameterState`& shared_state); :ref:`ModelLease` :target:`acquireGlobalModel`(); :ref:`ModelLease` :target:`acquireImageModel`(int i); bool :target:`imageModelEligibleForPrediction`(int i) const; void :ref:`predictAtImage`(int i, :ref:`gpr::Observation`& probe); void :ref:`observationVarianceAtImage`(int i, :ref:`gpr::Observation`& probe); template void :ref:`withImageChartFallback`(int i, Use&& use); template void :ref:`withImageModel`(int i, Use&& use); void :ref:`compactAfterRowRemoval`(int removed_row); bool :ref:`rollbackTrainingObservations`(Eigen::Index row_count); void :target:`appendIndexedObservations`(const std::vector<:ref:`IndexedObservation`>& observations); bool :target:`rollbackTrainingObservationsRetaining`(Eigen::Index row_count, const std::vector<:ref:`IndexedObservation`>& retained_observations); int :ref:`pruneTrainingObservationsAdaptive`(const :ref:`gpr::Coord`& band_positions); int :ref:`pruneTrainingObservationsToBudget`(const :ref:`gpr::Coord`& band_positions, Eigen::Index max_rows); int :ref:`pruneLeastInfluentialRow`(const :ref:`gpr::Coord`& band_positions, bool ignore_noise); int :ref:`pruneImageModelsAdaptive`(const :ref:`gpr::Coord`& band_positions); bool :ref:`refitGP`(bool reinit_seeds); const :ref:`policy::PolicyContext`* :target:`activePolicyContext`() const; void :target:`publishPolicyProgress`(int iteration, int oracle_calls, int refits, int training_size); bool :ref:`hyperparametersNeedRefit`() const; bool :ref:`refitGPIfTrainingChanged`(bool reinit_seeds); bool :ref:`wouldRefitAtNextRefresh`() const; void :ref:`refreshCovarianceCache`(); bool :ref:`conditionGPOnConsistentRows`(const :ref:`gpr::Observation`& acquired, :ref:`ConvergenceNormType` force_norm, Eigen::Index max_rows = 0, double force_tolerance = std::numeric_limits::infinity(), :ref:`gpr::GaussianProcessRegression::RefitTrustReport`* trust_report = nullptr); void :ref:`setEvidenceRefitTrigger`(bool enabled); bool :target:`evidenceRefitTrigger`() const; double :ref:`acquiredEvidenceNats`() const; bool :ref:`acquiredEvidenceRequestsRefit`(double batch_nats); bool :ref:`conditionGPOnResolvedRows`(const :ref:`gpr::Observation`& acquired, :ref:`ConvergenceNormType` force_norm, Eigen::Index max_rows, double force_tolerance); void :ref:`conditionGPOnTrainingData`(); }; .. _details-structgpr_1_1neb_1_1_active_learning_session: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Shared GP + training data state for an active-learning saddle search session. Caller-owned, passed by pointer to ~gpNEB~ and ~AtomicDimer~ entry points. Two GP tiers live here: * ~gp~ + ~training_obs~ :: the *global* GP, owning every oracle call from every phase (NEB explore, NEB CI, Dimer MMF). Used for hyperparameter optimisation and for prediction when the local GP at a given image lacks data. * ~image_models[i]~ :: per-image *local* GP slot. Each image i owns the subset of oracle calls evaluated while it was the worst image (NEB picker) or while it was the CI image (OCINEB burst). Local GPs inherit global theta; compatible EB and Laplace models also share its hyperparameter distribution. The image GP answers ~predictAtImage~ when the slot has at least ~min_per_image_n_train~ direct oracle rows; otherwise the call falls back to the global GP. Fields ------ .. index:: pair: variable; training_obs .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8f58c935b84b4a6e78d03d8b0303c806: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::Observation` training_obs Growing training data. Appended by every oracle call from every phase (NEB explore, NEB CI, Dimer MMF). .. index:: pair: variable; virtual_obs .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ad19fc2ec9d5f382dfbcd0a830cd1a43d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::Observation` virtual_obs Conditioning-only virtual observations (Riihimaki-Vehtari style conjugate constraints). Each row sits at an internal-trust clip point with targets equal to the prior mean there, so the fitted residual is exactly zero: the posterior is pinned toward the prior at geometries the trust certifier has declared unpredictable. Rows enter covariance conditioning and prediction only hyperparameter optimisation (SCG) and seed derivation see ~training_obs~ alone, so theta is calibrated against real oracle data. A row retires as soon as a real observation lands within its retire radius. .. index:: pair: variable; virtual_retire_radii .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a403077ef5703eecdc2859d2b5c939426: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector virtual_retire_radii Per-row coordinate-norm retire radii, aligned with ~virtual_obs~. .. index:: pair: variable; virtual_obs_noise_sigma2 .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ada1ecbd3afb2855562c0fbcd32121399: .. ref-code-block:: cpp :class: doxyrest-title-code-block double virtual_obs_noise_sigma2 = 0.04 Extra heteroscedastic noise sigma^2 on virtual rows (energy in eV^2, forces in (eV/A)^2 under the raw-target classic stack). Soft pins: large against the learned data noise (~1e-3) so a pin biases the posterior toward the prior without forcing an interpolation constraint through it; hard pins bend the posterior violently between nearby data and the pin (measured: max_gp_F 27 -> 175 on 17_claisen when pinned at shared noise). .. index:: pair: variable; ci_active_at_outer_start .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a10511ba0a19eb7c91adf38c8bee8f3d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool ci_active_at_outer_start = false CI already active when the current GP-NEB outer began. OCINEB uses this so force-only Helped after same-outer CI activation restores the pre-burst geometry instead of locking a high false TS. .. index:: pair: variable; ci_stable_outer_count .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a2e9f90f8af8f25aead6a04b6f0c22629: .. ref-code-block:: cpp :class: doxyrest-title-code-block int ci_stable_outer_count = 0 Consecutive outers that began with CI active. Force-only Helped restores unless this is >= 1 (CI already active at outer start) and the converged mode has negative curvature. .. index:: pair: variable; stagnation_handoff .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1af2e36c687082beb87e5e229195926e1d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool stagnation_handoff = false The climbing-image walk has stopped improving while its true force is still above the final tolerance: a curvature-cap limit cycle that the band stall ended, or a fixed point whose granted MMF burst the adaptive bar would otherwise refuse. The next OCINEB hook keeps the flag until the dimer lease is taken, or until the certified handoff declines it. A closed information gate does not clear it. A walk that is still descending does not set it, and the 0.1 eV/A handoff bar is unchanged for that walk. .. index:: pair: variable; last_max_chain_energy_variance .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1afe2c0dae5a5105899acf6583f7907bfc: .. ref-code-block:: cpp :class: doxyrest-title-code-block double last_max_chain_energy_variance = std::numeric_limits::quiet_NaN() Latest max per-image chain energy variance from the GP-NEB outer loop's acquisition probe. NaN until the first probe. The OCINEB hook compares it against the likelihood noise floor to decide whether the OIE can still supply admissible information. .. index:: pair: variable; current_chain_certificates .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1afa02e76485a400f7ffddea80dae708be: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`IndexedObservation`> current_chain_certificates Per-image true-PES evidence at a live chain geometry. Certificates own their exact energy and gradient independently of the GP training transaction, so model rollback cannot erase convergence evidence. .. index:: pair: variable; gp .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac59701059d2d9b5521598a04ef22eaa5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::GaussianProcessRegression` gp Global GP instance. Initialised lazily via ~initialise()~ from ~gp_setup~. Owns hyperparameter optimisation and the dense distributed Cholesky used for chain-wide variance probes. .. index:: pair: variable; image_models .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a87fb110799cfc629d94291cd05e4c84c: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`ImageModel`> image_models Per-image local GPs. One slot per path image; endpoints are present for index alignment but are only used when explicitly sampled. .. index:: pair: variable; min_per_image_n_train .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a3eff306d6aa5f64dcd7c55810f67f5eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block int min_per_image_n_train = 3 Fallback threshold: ~predictAtImage(i, ...)~ routes through the global ~gp~ until image i's geometric neighbourhood has this many distinct oracle observations. Once reached, the local GP takes over for image-resolved predictions. .. index:: pair: variable; per_image_knn .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a1908b31554835d24ddbb83f2c4941533: .. ref-code-block:: cpp :class: doxyrest-title-code-block int per_image_knn = 10 Neighbourhood size for the per-image local GP: image i's local training set is the ~per_image_knn~ observations of the global ~training_obs~ nearest (EMD) to image i's current position, recomputed every outer iteration. Keying the local set on geometry rather than on the picker index keeps the per-image surrogate tracking the moving chain: an image picks up its chain neighbours' oracle calls, and a converged image is no longer conditioned on the scattered positions it has left. .. index:: pair: variable; per_image_prior_s2_log .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aba0c96d9ce1593cbda88283c0584dab5: .. ref-code-block:: cpp :class: doxyrest-title-code-block double per_image_prior_s2_log = 0.1 Variance of the hierarchical-Bayes prior on the per-image log-kernel-parameters: ~log(theta_i) ~ N(log(theta_global), per_image_prior_s2_log \* I)~. Default 0.1 corresponds to roughly ~30% drift around the global MAP per parameter (in linear lengthscale / magnSigma2). Without this prior, per-image SCG on 3-10 rows is unregularised and drifts to noisy local optima; the resulting inflated per-image variance stalls the NEB acquisition picker in Phase 1. Tighter values pull per-image theta_i closer to the global anchor. .. index:: pair: variable; atoms_config .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac912ac23c12613bc065d4da434ef100a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::AtomsConfiguration` atoms_config Atoms configuration cached from ~gp_setup~. Required by ~setHyperparameters~ and the EMD distance metric. .. index:: pair: variable; input_parameters .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a54c81361644a6d358898d3264d032113: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::InputParameters` input_parameters Input parameters cached from ~gp_setup~. Per-image local GPs are clones of the global setup and do not re-enter the caller's setup callback. .. index:: pair: variable; gp_setup .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a65b1d5e49b5c7df61d11ac48e223ec3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::function`&, :ref:`gpr::AtomsConfiguration`&)> gp_setup Callback that builds the (parameters, atoms_config) pair the GP needs to ~initialize()~. Same shape as ~GPNEBConfig::gp_setup~. Populated by the caller (typically from a loaded ~.con~ frame). .. index:: pair: variable; path_energy_ceiling .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a219a865fa9c0c14e4955639b8bbf4217: .. ref-code-block:: cpp :class: doxyrest-title-code-block double path_energy_ceiling = std::numeric_limits::infinity() Optional absolute saddle-energy limit supplied by the caller and shared with the OCINEB burst. Infinity disables it. Sampled path energies do not supply an upper bound on the continuous path maximum. .. index:: pair: variable; initialised .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1afb8d2cf1aa37bff9d8e19194db04e1fd: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool initialised = false True once ~initialise()~ has populated ~gp~ + ~atoms_config~ from ~gp_setup~. Idempotent across calls. .. index:: pair: variable; training_multiplicity .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac8484cacca44f96a6aba599e7acb3464: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector training_multiplicity Repeated-observation count per training row (>= 1), aligned with ~training_obs~ rows. Methods ------- .. index:: pair: function; setSecantHessianConfig .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a15d454fad450c37ad131ea1219fb5921: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSecantHessianConfig(const :ref:`optim::SecantHessianConfig`& config) Configure true-gradient secants independently of GP row retention. Changing the method rebuilds the global stream and every per-image stream from the measurements already consumed. Rows retained before any secant existed have no image index, so they enter the global stream only. .. index:: pair: function; purchaseSecantConsistencyProbe .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a31175da7b7f52b46f0d09782e5024f9d: .. ref-code-block:: cpp :class: doxyrest-title-code-block template bool purchaseSecantConsistencyProbe(Measure&& measure) Compare the fitted GP Hessian action with the latest true-force secant. A disagreement buys one forward force probe. ``measure`` evaluates that probe and retains it, and returns false when the oracle budget or the oracle itself did not deliver it; that probe is not counted. .. index:: pair: function; noteTrueForceSecant .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8c888ad70edc3b73d7d6ad6f0fe88dcd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void noteTrueForceSecant(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient) True-force secant only. Training retention is unchanged. .. index:: pair: function; secantReplaySize .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a13b1693128920d62a3a7e11a31ec4a6f: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t secantReplaySize() const Samples kept so reconfigure can rebuild per-image secant seeds. .. index:: pair: function; secantReplayTrainingRows .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ab60602bce10ce35fe40a0cbda619e919: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t secantReplayTrainingRows() const Replay samples that record an admitted training row. .. index:: pair: function; secantReplayHoldsTrainingRow .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a9ce55de59fd68d60cc0e9a435bd7c168: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool secantReplayHoldsTrainingRow(const Eigen::VectorXd& position) const True when an admitted-row sample still holds ~position~. .. index:: pair: function; addSecantCounts .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aa5a26525fa5e7ce0709b71f9e20d4ade: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addSecantCounts(const :ref:`optim::SecantCurvatureCounts`& extra) A dimer that owns its surrogate passes its full counts. A dimer leasing this session's GP passes the ledger only; the shared GP's quadratic-mean uses are already on ``:ref:`gp ```. .. index:: pair: function; setLikelihoodNoiseFloorRms .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a1f7d9b3f36ec2774a21ed12eb05048ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLikelihoodNoiseFloorRms(const double* noise_rms) Set a live RMS floor for the Gaussian likelihood noise. The session squares valid positive values into sigma^2 during ~refitGP~; null, non-finite, and non-positive values disable the floor. .. index:: pair: function; setRefitTrainingRevisions .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac8b674d456777d0e092e9cfcefefc7f9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setRefitTrainingRevisions(std::uint64_t revisions) SCG refit cadence: full hyperparameter refits run every this many training-set appends, for every model profile. Default 5 is the Baker-measured value; ActiveGP makes the knob explicit. Zero means refit on every refresh. .. index:: pair: function; surfaceEpoch .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a87577ba342d500780ad598b3574a90b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::uint64_t surfaceEpoch() const Monotone surface epoch. Bumps when the factorized posterior changes (refit or materialize). Mix into a consumer cache key so a frozen GprMeanPotential cannot relax on a stale PES. .. index:: pair: function; refreshLikelihoodNoiseFloor .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a9f508d092e6cd009844709cc6a0fd7b1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void refreshLikelihoodNoiseFloor() Reduce the rank-owned noise floor into the shared value the materialise paths read. This call is collective: every rank must reach it, so it belongs at a point in the outer loop that no rank-local branch can skip after an oracle batch, never inside a per-image or owned-image block. .. index:: pair: function; initialise .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aee45dbf47983fb6ab768a77c3a084f81: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initialise() Idempotent: build ~gp~ + ~atoms_config~ from ~gp_setup~. After this the GP is ready for ~setHyperparameters~ + ~optimize~ but holds no training data yet. .. index:: pair: function; applySeededModel .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a154580d0d3dbfd30537c81892c3a221d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool applySeededModel() Install a warm-start kernel after the search has applied its model profile and pair cutoff. :ref:`initialise() ` leaves the GP on the profile default, so the saved kernel would not match yet. False when this search had no seed or the seed hook refused to install the kernel. .. index:: pair: function; setAfterInitialise .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a4cc8e25440ce7d2fcf57093881200e93: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAfterInitialise(:ref:`AfterInitialise` hook) Runs from :ref:`applySeededModel() `, after the search profile and the pair cutoff are on the GP. A warm start installs saved hyperparameters here. .. index:: pair: function; priorObservations .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a7d579be8afcb5d8922b7572baf20bc67: .. ref-code-block:: cpp :class: doxyrest-title-code-block int priorObservations() const Rows loaded from a seed file. Not an oracle-call count. .. index:: pair: function; noteExternalHyperparameterFit .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a5d0281032dc8f43d088bc2119e530159: .. ref-code-block:: cpp :class: doxyrest-title-code-block void noteExternalHyperparameterFit() :ref:`applySeededModel() ` installed hyperparameters for the rows held now. Later appends still request a refit. .. index:: pair: function; updateFrozenEnvironment .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a779ebabc41f6e44508385a210fcae47e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool updateFrozenEnvironment(const :ref:`gpr::Coord`& band) Select one frozen environment over every image, retaining physical observations and invalidating models that depend on its pair features. .. index:: pair: function; initializePerImage .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ae1a6252e78be7f9f64e65b15ad1496ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initializePerImage(int n_images) Allocate per-image local GPs sized to the NEB chain. Each local GP gets the same kernel setup as the global ~gp~ (same ~gp_setup~ -> identical kernel functions / atoms config) but starts with an empty training set. Idempotent: redundant calls with the same ~n_images~ are no-ops; resizing to a different chain length blows away the previous per-image state. .. index:: pair: function; boundActiveSetToBand .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a50b7b8f6110525968a82f09ca467edb9: .. ref-code-block:: cpp :class: doxyrest-title-code-block int boundActiveSetToBand(const :ref:`gpr::Coord`& band_positions, Eigen::Index max_rows) Retain band support and acquired corrections within a row budget. A sweep of recent acquisitions protects rejected trial and dimer observations outside the retained band. Each band image then reserves its nearest row in the prediction kernel's metric. Among the other rows the one whose removal changes the posterior mean least in the kernel norm is dropped first; the observation archive is intact. .. index:: pair: function; observationResolutionFloor .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac630da33b64ee835d20cbc09ad953b6d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double observationResolutionFloor() const Spacing below which a new row carries no information the model can use, taken from the model's own state rather than set as a number. This is the dimer's information floor, d = l \* sqrt(noise/magn) / 2: the posterior curvature recoverable from observations spaced d apart halves there, so rows closer than that add no curvature information at the live noise level and only degrade conditioning. The dimer has bounded itself with it for a while; ``GPNEB.h`` says in as many words that the band path needs the same and does not have it. Returns a non-positive value when the model cannot state one yet, in which case the caller admits the row. .. index:: pair: function; nearestTrainingDistance .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aa70bc0e8b13758a7307c8f808a959067: .. ref-code-block:: cpp :class: doxyrest-title-code-block double nearestTrainingDistance(const Eigen::VectorXd& positions) const Nearest training row to ``positions``, in the metric the floor is stated in. EMD, not a Cartesian norm. The floor above is the dimer's, and the dimer compares it against dist_emd; the archive's own neighbourhood selection uses dist_emd too. A Cartesian norm would be a different metric wearing the same threshold, and it would also call two configurations far apart when they differ only by relabelling equivalent atoms. .. index:: pair: function; appendObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1af30c8301c52632dec66764b4fd6a4a00: .. ref-code-block:: cpp :class: doxyrest-title-code-block void appendObservation(const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`) Append one observation row to ~training_obs~. Mirrors the internal ~appendObservation~ helper in ~GPNEB.cpp~; lives here so the controller can use it directly without leaking that helper. Every distinct oracle acquisition is a joint energy-and-force observation and is retained in full. .. index:: pair: function; setEndpointSymmetry .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8115ee72306a6a295c5ef9c14ba40e36: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setEndpointSymmetry(:ref:`EndpointSymmetry` symmetry) Exchange symmetry of the band's endpoints. While it is set, every admitted oracle row also enters at its symmetry image, which is an exact observation of the same potential (see ~EndpointSymmetry~). The image is not an acquisition: it never reaches the observation archive, and an archived row regenerates it on adoption. Rows already in the training set enter at their images when it is set, unless the image is already a row. An empty symmetry clears it. .. index:: pair: function; symmetryRowsAdmitted .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1af699045fce73525b64376ef4929b5d38: .. ref-code-block:: cpp :class: doxyrest-title-code-block long symmetryRowsAdmitted() const Symmetry-image rows admitted, and those refused because a training row already lay within the model's resolution of the image, or within the operation's own (~EndpointSymmetry::resolution~). .. index:: pair: function; setResolutionDedup .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aa0e8324cadc8f75a4d022b6ea3c4d74b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setResolutionDedup(bool on) Admit rows only when they are farther apart than the model can resolve. Off by default: it declines data, and what that costs in acquisitions wants measuring before it is anyone's default. .. index:: pair: function; withinTrainingResolution .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1abec0a204d4b2aa5923e88f069231d4af: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool withinTrainingResolution(const Eigen::VectorXd& positions) const True when ~appendObservation~ would refuse a row at ``positions`` under the resolution gate: a training row already lies closer than the model's own resolution floor, so a measurement there is informationless and the posterior at ``positions`` is the data. Certificates that demand "current oracle data" at an image must accept this state as observed, or they wait forever for a row the session will never store. .. index:: pair: function; admitObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aab2dcff263a9067e110129e53cac8174: .. ref-code-block:: cpp :class: doxyrest-title-code-block int admitObservation(const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`) The row holding ``positions`` after a merge or an append, or -1 when the resolution gate refused it. .. index:: pair: function; appendSymmetryImage .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8a5e5ea69fc234c4bbb753465f8dff0e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void appendSymmetryImage(int source_row, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient) Enter the symmetry image of the row at ``source_row``. A repeated image merges like a repeated draw, which keeps it the image of the source row's count-weighted target. The resolution gate applies whatever gp-resolution-dedup says: the image of a geometry the symmetry fixes, the saddle among them, lands on its source to rounding, and a derived row inside the model's resolution of a training row adds nothing. .. index:: pair: function; syncTrainingMultiplicity .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a072c25b562a4ae59d5fc3f0cf5a14f8a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void syncTrainingMultiplicity() Keep ~training_multiplicity~ aligned with ~training_obs~: new rows enter with multiplicity one, suffix truncation drops the tail. Interior removals are handled at their removal site. .. index:: pair: function; noteExternalTrainingEdit .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1af06a6656fa5bd47679f643c47c46cb44: .. ref-code-block:: cpp :class: doxyrest-title-code-block void noteExternalTrainingEdit() Rows of ~training_obs~ were replaced outside append and prune. The fitted factor no longer matches, so the next refit rebuilds it. .. index:: pair: function; retainTrainingRowsForPolicy .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a92905ac76c9f19364cbe98cd3292b756: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool retainTrainingRowsForPolicy(const :ref:`policy::TrainingPolicy`& policy) Apply ~policy.retain_training_rows~. An identity list does nothing. Any other list rebuilds the training set, the multiplicity, every image index map, and the factor at the current hyperparameters. The fitted revision is left alone: theta was not re-optimised. .. index:: pair: function; addVirtualObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8c7095ed0a0351995ee38a0131164f4f: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool addVirtualObservation(const Eigen::VectorXd& positions, double retire_radius) Pin the posterior toward the prior at ~positions~ with a conditioning-only virtual observation (targets = prior mean and prior gradient there, residual zero under the model's own prior-mean subtraction). Skipped when a real or virtual row already sits within ~retire_radius~ (coordinate norm): a real row means the model has genuine information there; a virtual one means the pin already exists. Bounded at ~kMaxVirtualObservations~ rows, oldest replaced first. Returns true when a row was inserted; the caller re-conditions via ~refreshCovarianceCache~. .. index:: pair: function; retireVirtualObservationsNear .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1accdbe7b1a2349a9db19ada1ff6d82fd1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void retireVirtualObservationsNear(const Eigen::VectorXd& positions) Drop every virtual row whose retire radius covers ~positions~. Called on each real append: a genuine measurement supersedes the prior pin in its neighbourhood. .. index:: pair: function; syncVirtualNoiseTag .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aa8db0332aa97029a04c3df148b72fe8e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void syncVirtualNoiseTag() Push the current virtual-geometry set and its noise into the likelihood so every subsequent covariance assembly tags the matching rows. Real-only assemblies contain no matching geometry and stay bit-identical. .. index:: pair: function; composedTrainingObs .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a00fd1c1a9f1ab2b484a68fb329f1684a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`gpr::Observation` composedTrainingObs() const ~training_obs~ with the virtual rows appended, for covariance conditioning and prediction. Hyperparameter fitting keeps using ~training_obs~ directly. .. index:: pair: function; appendObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a639f2285121e91177a19e59deccb03ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block void appendObservation(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`) Dual-update overload: append to the global ~training_obs~ AND to image ~image_idx~'s local training set. The per-image set drives ~predictAtImage(image_idx, ...)~ once its direct row count crosses the ~min_per_image_n_train~ threshold; below threshold those calls fall through to the global ~gp~. Out-of-range ~image_idx~ (or per-image storage uninitialised) just degenerates to a global-only append, matching the single-argument overload. .. index:: pair: function; attachImageObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1afe2ed3ccd033f465720c0ef4cdb987ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool attachImageObservation(int image_idx, int global_row_index) Bind an acquired canonical row to an image without treating its reuse as another draw from the oracle. :ref:`Image ` targets use the canonical mean. .. index:: pair: function; appendCurrentChainObservation .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a58cab64d40ac1bdf5ae134e8b77b633e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void appendCurrentChainObservation(int image_idx, const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, :ref:`ObservationRetention` retention = :ref:`ObservationRetention::RecordAcquisition`, :ref:`optim::SecantAccounting` secant_accounting = :ref:`optim::SecantAccounting::Count`) Append a force-quality observation at the live chain geometry and bind its certificate to that image and position. The row is durable because path certificates must survive restart and covariance refresh. .. index:: pair: function; setImageNeighborhood .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1adaef4789e590a45d7095de4b96286331: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setImageNeighborhood(int i, const std::vector& emd_indices, const Eigen::VectorXd* image_position = nullptr) Rebuild image ~i~'s local training set as the trajectory-aware union of two index sets over the global ~training_obs~: * ~emd_indices~ :: the EMD k-nearest observations to image ~i~'s current position. Tracks the moving chain so an image picks up its neighbours' oracle calls. * ~model.directIndices()~ :: every row image ~i~ was oracled at directly its own search / climb trajectory. The EMD set alone is a recent spatial cluster: for a climbing image it is the last few uphill steps, and a GP fit on that extrapolates the ascent without bound. Unioning the image's own oracle history keeps the trajectory that bounds the climb. Recomputed every outer iteration; a no-op when the union already matches the slot's selection, otherwise the row set changed and the cached per-image factor is invalidated so the next predict refits. ``image_position``, when given, additionally re-selects archived rows: acquisitions the global pruner removed from ~training_obs~ but which sit EMD-nearer to this image than its farthest kept training row come back from the readcon-db corpus. The double-GP sets are disjoint views; the archive is what makes that divergence non-destructive. .. index:: pair: function; selectArchivedNeighbors .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1af525c968a5559953cee19177d53f60e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector selectArchivedNeighbors(const std::vector& kept, const Eigen::VectorXd* image_position, Eigen::Index D) Archived-row candidates for one image: rows in the corpus that no longer coincide with any active training row and whose EMD to the image position is within the admission radius (the image's farthest kept training row; unbounded while no rows are kept). At most ~per_image_knn~ rows, nearest first. .. index:: pair: function; setImageInternalCoordinateChart .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a171bb8903cfe7cf8f5afb7c23f7192b4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool setImageInternalCoordinateChart(int i, std::shared_ptr`> chart) Anchor image ~i~'s local GP to a nonredundant molecular tangent chart. The intrinsic scalar length is inherited by matching the fitted global GP's tangent force variance. An unavailable global metric clears a stale chart and leaves prediction on the ordinary global fallback. .. index:: pair: function; setGlobalInternalCoordinateChart .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ae41a12deeea8ade04383c82a55aa4110: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool setGlobalInternalCoordinateChart(std::shared_ptr`> chart) Anchor the GLOBAL :ref:`Sexpat ` energy-force tensor on a nonredundant molecular tangent chart. The isotropic intrinsic length is matched to the current global force variance. A missing metric or an invalid chart leaves Cartesian :ref:`Sexpat ` in place; a heat prior composes with it. .. index:: pair: function; setBandGeodesicReferencePath .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a20df505ef46ef3e8f150a8bb7215260e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool setBandGeodesicReferencePath(const :ref:`gpr::Coord`& reference_path) Supply the GLOBAL GP with a band reference path for the soft geodesic heat prior, without touching per-image local models. The additive amplitude is evidence-fitted at each ~refitGP~ (a zero optimum retains the base covariance; see docs/orgmode/explanation/theory/soft_geodesic_heat_kernel.org and scripts/derive_soft_geodesic_energy_force_gp.py). .. index:: pair: function; setImageGeodesicReferencePath .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8f42bae71cfb2d020ab899e7f9eb17d1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool setImageGeodesicReferencePath(int i, const :ref:`gpr::Coord`& reference_path) Supply image ~i~'s local GP with the live whole-band geometry used to construct its soft geodesic heat covariance. The path amplitude is fitted from this image's joint energy-gradient observations at refit. .. index:: pair: function; refitImageGP .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac7cb3184f63499ad599288d84f44b33e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refitImageGP(int i) Refit image ~i~'s local GP on its current training data, with theta inherited from the global ~gp~. Compatible EB and Laplace models share its parameter measure and condition on local rows. Distinct conditioning sets can give different boundary predictions. Returns false when no valid local posterior can be materialized. .. index:: pair: function; ensureSingletonForGlobal .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ae34e6f2a619c62123bf30523efa6f298: .. ref-code-block:: cpp :class: doxyrest-title-code-block void ensureSingletonForGlobal() Ensure the global ~gp~ owns the singleton. Cheap when already active with a usable posterior; refactorises the global K when the recorded owner has lost the process-wide factor or when switching from a per-image owner. Call before any ~gp.calculate\*~ or any ~gp~ predict that needs the cached factor. .. index:: pair: function; ensureSingletonForImage .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a1a4f6cdc873e9848eac1d0817dc4c100: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool ensureSingletonForImage(int i) Ensure image ~i~'s local GP owns the singleton, refitting on demand. Cheap when already active; otherwise re-syncs theta from the global and refactorises the per-image K. Call before any ~image_models[i]. :ref:`gp() ` ->calculate\*~ predict. .. index:: pair: function; predictAtImage .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a7ef4a4be1dec2651297ba436dd6a8ce3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void predictAtImage(int i, :ref:`gpr::Observation`& probe) Per-image predict with global fallback. Returns the predicted (energy, gradient) in ~probe~. If image ~i~'s local set has at least ~min_per_image_n_train~ neighbourhood rows the call goes through the local GP; otherwise it routes through the global ~gp~. .. index:: pair: function; observationVarianceAtImage .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a220e017b4166d43774395ddce5a56f0a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void observationVarianceAtImage(int i, :ref:`gpr::Observation`& probe) Per-image joint energy-and-gradient variance with global fallback. The returned :ref:`Observation ` carries every channel used by acquisition. .. index:: pair: function; withImageChartFallback .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a8c6249d7acc462df1b5d023e3d3507fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void withImageChartFallback(int i, Use&& use) Run ~use~ on image ~i~'s model, or on the global model when the image has too few rows of its own. A chart is built from the primitives that are defined along the path when it is attached; a training row or a probe that puts three atoms of a dihedral on a line leaves that primitive undefined, and the chart no longer describes the region the model covers. The image then drops its chart and the call runs again on the Cartesian pair kernel. Only an undefined primitive is recovered; any other error, and any error on an image without a chart, passes on unchanged. .. index:: pair: function; withImageModel .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a27acd889e7dd14b68ee23822d7bb3347: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void withImageModel(int i, Use&& use) Run ~use~ on image ~i~'s model, dropping a chart that is undefined at a row or probe and running again on the Cartesian pair kernel. .. index:: pair: function; compactAfterRowRemoval .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a7c07a4f66d03367673909b3496e33b4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void compactAfterRowRemoval(int removed_row) A row was removed from ~training_obs~ (rollback of speculative rows): compact every per-image model's index views in step. .. index:: pair: function; rollbackTrainingObservations .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a438ecf7b1f784d2f5efb8dabc58f9b3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool rollbackTrainingObservations(Eigen::Index row_count) Remove speculative suffix rows from the global training buffer and compact every per-image view that references those rows. .. index:: pair: function; pruneTrainingObservationsAdaptive .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1acf9aa6b1ad727fa954e4cb5081c089a2: .. ref-code-block:: cpp :class: doxyrest-title-code-block int pruneTrainingObservationsAdaptive(const :ref:`gpr::Coord`& band_positions) Adaptive pruning: drop training observations whose removal moves the posterior energy and every Cartesian force at every band point by less than the likelihood noise. The influence is the exact block downdate (see ~GaussianProcessRegression::observationBandInfluence~ and scripts/derive_adaptive_pruning_influence.py), so the threshold is a unit comparison against noise rather than a tuned constant: a row that cannot move any band prediction by one sigma carries no information the band posterior uses, while it still costs O(n^3) in every later refit. Per-image models hold global row indices, so every removal is mirrored through ~ImageModel::compactAfterRowRemoval~, which drops references to the removed row and shifts the rest down. Removals run highest index first so earlier compactions never disturb the indices still to be removed. Returns the number of pruned observations. .. index:: pair: function; pruneTrainingObservationsToBudget .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a579d14f35c4ec2e5dc761b90b12d7763: .. ref-code-block:: cpp :class: doxyrest-title-code-block int pruneTrainingObservationsToBudget(const :ref:`gpr::Coord`& band_positions, Eigen::Index max_rows) Prune down to a row budget, least influential first. The threshold prune below removes a row only when it moves the band by less than one likelihood sigma. On these runs that never holds: no [prune] line appears in any campaign log while the training set climbs past 150 observations. Nothing is redundant by that test, so nothing is dropped, and the set grows without bound. That is what makes an outer iteration cost grow: the kernel order is the observation count times (1 + 3 natoms), the append is two O(m^3) steps, and summing that over a run is quartic in the outer count. A budget converts it to linear. Influence is recomputed between removals for the reason the threshold prune states: deleting a row changes what every other row is worth, so a batch decided against one stale vector collapses correlated groups. That costs an influence evaluation per removal, which is cheap beside the factorisation it saves. .. rubric:: Returns: rows removed. .. index:: pair: function; pruneLeastInfluentialRow .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ac2e584c31ebcdd1f896c47ecb85c38fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block int pruneLeastInfluentialRow(const :ref:`gpr::Coord`& band_positions, bool ignore_noise) Remove the single least influential row. ``ignore_noise`` drops it regardless of the one-sigma test, which is what a budget needs: the question there is not whether the row is redundant but whether it is the least useful of the ones that no longer fit. .. index:: pair: function; pruneImageModelsAdaptive .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a62a7f8817801e92639b882ec351e74be: .. ref-code-block:: cpp :class: doxyrest-title-code-block int pruneImageModelsAdaptive(const :ref:`gpr::Coord`& band_positions) Per-image adaptive pruning across every activated single-image GP: each model prunes against its own band point only. The global set stays as the double-GP concept demands the global model hands over to the single-image ones, and each of those conditions on an adaptively pruned local set. .. index:: pair: function; refitGP .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a9cb7e67a0656f9f28368eafe8cdcc7b7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refitGP(bool reinit_seeds) Convenience: refit hyperparameters then optimize. ~reinit_seeds~ controls whether ~setHyperparameters~ re-derives seeds from data statistics (cold) or warm-starts from the previous fit. See ~GPNEB.cpp~ for the cold/warm rationale. Returns false when a training policy keeps the hyperparameters and only the factor is updated. .. index:: pair: function; hyperparametersNeedRefit .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a70693417c6436484c41d348ea4c674e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hyperparametersNeedRefit() const A covariance refresh can condition the current theta on new rows, but only ~refitGP~ calibrates theta against those rows. This predicate keeps the two states distinct for phases that append data between outer-loop refits. .. index:: pair: function; refitGPIfTrainingChanged .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ab7ab1cf85a8fae049200b9c3d4449560: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool refitGPIfTrainingChanged(bool reinit_seeds) Warm-refit only when the training set changed since the fitted theta. Returns true when a refit was performed. .. index:: pair: function; wouldRefitAtNextRefresh .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a2d192490945fe19da251834ec660df8b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool wouldRefitAtNextRefresh() const True when the next ~refreshCovarianceCache~ would run a full hyperparameter refit rather than a fixed-theta rematerialize. Pruning is only free at such a point. A refit rebuilds the factorization from scratch anyway, so dropping rows costs nothing extra there; dropping them between refits instead turns the next rematerialize from a suffix append into a full O(n^3) rebuild, because the training matrix is no longer an extension of the one the cached factor was built on. .. index:: pair: function; refreshCovarianceCache .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1aa27f5c907049bb3dd0fda9789141d508: .. ref-code-block:: cpp :class: doxyrest-title-code-block void refreshCovarianceCache() Rebuild ~gp~'s internal model state (R_matrix, R_indices, energy_and_gradient, distributed Cholesky factor, posterior weights) from the current ~training_obs~ WITHOUT re-running hyperparameter optimisation. Use after a sibling phase (e.g. OCINEB MMF burst) mutates ~training_obs~ between outer-iter retrains: the burst's internal AtomicDimer GP factorises a different-sized covariance into the singleton ~DistributedState~ cache, so ~gp~'s distributed L is stale by the time the next NEB iter probes variance / runs a solve. ~updateModelWithFullData~ reassembles R_matrix and calls ~decomposeCovarianceMatrix~, which repopulates the singleton cache with ~gp~'s factor at the new training size. Cheaper than ~refitGP~ (no SCG NLML evaluations); the next outer iter's natural retrain handles hyperparameter updates. .. index:: pair: function; conditionGPOnConsistentRows .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a9471360c3fc047c76550f1fe6061947c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool conditionGPOnConsistentRows(const :ref:`gpr::Observation`& acquired, :ref:`ConvergenceNormType` force_norm, Eigen::Index max_rows = 0, double force_tolerance = std::numeric_limits::infinity(), :ref:`gpr::GaussianProcessRegression::RefitTrustReport`* trust_report = nullptr) Condition acquired rows when their forces agree with the proposing posterior. The caller appends them to training_obs without conditioning the GP first, so the comparison uses predictions made without the rows. Exceeding the row ceiling requires pruning and a full refit. .. index:: pair: function; setEvidenceRefitTrigger .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a26303ffadf452caf1075b5e6b7f6156d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setEvidenceRefitTrigger(bool enabled) Switch the refit decision of ~conditionGPOnConsistentRows~ from the force-resolution test to the accumulated contradiction evidence. .. index:: pair: function; acquiredEvidenceNats .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a17d274537a830df241dc6f83c105a394: .. ref-code-block:: cpp :class: doxyrest-title-code-block double acquiredEvidenceNats() const Contradiction evidence (nats) of the rows conditioned since the last hyperparameter fit. .. index:: pair: function; acquiredEvidenceRequestsRefit .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a32509039d501df447c13c5475aa6d65c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool acquiredEvidenceRequestsRefit(double batch_nats) Add a batch's evidence to the running sum. True when the sum reaches one nat, the amount a refit can learn about theta; the sum then restarts at the next fit and is left unchanged here. .. index:: pair: function; conditionGPOnResolvedRows .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1ae9cdf5b6c128c6c91c03254f426c6abe: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool conditionGPOnResolvedRows(const :ref:`gpr::Observation`& acquired, :ref:`ConvergenceNormType` force_norm, Eigen::Index max_rows, double force_tolerance) Assimilate a statistically consistent measurement, then require its conditioned force error and uncertainty to resolve the physical scale. A broad predictive distribution can narrow when the measured row is added; broad uncertainty alone is not evidence against the kernel. False requests a refit and may leave the new rows conditioned. .. index:: pair: function; conditionGPOnTrainingData .. _doxid-structgpr_1_1neb_1_1_active_learning_session_1a47e1c654ca9bdf952bb86375d0ce08cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void conditionGPOnTrainingData() Condition every retained observation at the fitted kernel parameters. The fitted training revision remains unchanged so a continued search can distinguish posterior conditioning from hyperparameter fitting.