struct gpr::neb::ActiveLearningSession::ImageModel

Overview

Per-image local model slot. More…

#include <gpr/neb/Session.h>
 
struct ImageModel {
    // methods
 
    void setGP(std::unique_ptr<gpr::GaussianProcessRegression> next_gp);
    gpr::GaussianProcessRegression* gp();
    const gpr::GaussianProcessRegression* gp() const;
    const gpr::Observation& observations() const;
    void updateConfiguration(const gpr::AtomsConfiguration& configuration);
    void setInternalCoordinateChart(std::shared_ptr<const gpr::geometry::InternalCoordinateChart> chart, double length_scale);
    void clearInternalCoordinateChart();
    const std::shared_ptr<const gpr::geometry::InternalCoordinateChart>& internalCoordinateChart() const;
    double internalCoordinateLengthScale() const;
    void setGeodesicReferencePath(gpr::Coord reference_path);
    void clearGeodesicReferencePath();
    bool hasGeodesicReferencePath() const;
    const gpr::Coord& geodesicReferencePath() const;
    std::uint64_t observationRevision() const;
    std::uint64_t surrogateRevision() const;
    std::uint64_t synchronizeSurrogateRevision(const Eigen::VectorXd& theta_global, double likelihood_noise_floor_sigma2, const SharedParameterState& shared_state = {}) const;
    const std::vector<int>& selectedIndices() const;
    const std::vector<int>& directIndices() const;
    bool hasEnoughRows(int n_min) const;
    int directObservationCount() const;
    bool hasEnoughDirectRows(int n_min) const;
    void appendObservation(const Eigen::VectorXd& positions, double energy, const Eigen::VectorXd& gradient, int global_row_index);
    void refreshSelectedObservation(int global_row, const gpr::Observation& global);
    void compactAfterRowRemoval(int removed_row);
    void remapGlobalRows(const std::vector<int>& old_to_new, const gpr::Observation& global);
    int pruneAdaptiveAtPoint(const Eigen::VectorXd& band_point);
    void replaceNeighborhood(gpr::Observation observations, std::vector<int> selected_indices, std::vector<uint64_t> archived_keys = {});
    const std::vector<uint64_t>& archivedKeys() const;
    bool materializedFor(const Eigen::VectorXd& theta_global, double likelihood_noise_floor_sigma2, const SharedParameterState& shared_state = {}) const;
    void recordMaterialized(const Eigen::VectorXd& theta_global, double likelihood_noise_floor_sigma2, const SharedParameterState& shared_state = {});
};

Detailed Documentation

Per-image local model slot. The slot owns both its observations and the factor materialization state, so every mutation invalidates through the same object that hands out model leases.

Methods

std::uint64_t observationRevision() const

Monotonic version of the local conditioning data. It advances only when the observations available to this image change, so callers can distinguish a genuinely refreshed local model from unrelated growth of the global training set.

std::uint64_t surrogateRevision() const

Monotonic version of every input that defines this image’s GP. Local observations, inherited global hyperparameters, and the live likelihood-noise floor all affect predictions consumed by MMF, even when the local row set itself is unchanged.

const std::vector<int>& selectedIndices() const

Rows of the global ~training_obs~ currently selected into ~observations~ the EMD k-nearest neighbourhood of this image’s position. Ascending-sorted so a caller can compare it against a freshly computed selection to decide whether the neighbourhood membership turned over.

const std::vector<int>& directIndices() const

Global ~training_obs~ rows this image was oracled at directly its own search / climb trajectory. Append-only; unlike ~selected_indices_~ it survives ~replaceNeighborhood~ so the trajectory-aware neighbourhood union can always re-include it.

bool hasEnoughDirectRows(int n_min) const

Number of distinct direct-image rows retained after position deduplication. Repeated oracle calls at the same geometry do not make the local GP eligible because they do not add independent conditioning information.

void refreshSelectedObservation(int global_row, const gpr::Observation& global)

A selected global row retains its identity when repeated oracle draws update its targets. Invalidate this image’s posterior only when the selected observation changes.

void compactAfterRowRemoval(int removed_row)

A global training row was removed: drop references to it and shift every index above it down by one, in the same order the removals happened. Removing a selected row changes the local conditioning data; shifting unrelated global indices does not.

void remapGlobalRows(const std::vector<int>& old_to_new, const gpr::Observation& global)

Rewrite global-row indices after a policy prune. ~old_to_new~ maps a previous training row to its row in ~global~, or -1 when that row was dropped. The local observations and, when this image already has a posterior, its factor follow the new order.

int pruneAdaptiveAtPoint(const Eigen::VectorXd& band_point)

Per-image adaptive pruning at this image’s own band point. After the global-to-single handover each image GP conditions on its own selected rows, so the influence question is local: can this row move THIS image’s posterior energy by one likelihood sigma. One removal per event, the same exactness argument as the session-level pruner. The removal is local only the global training row survives so selected/direct index maps drop the entry without shifting, and the handover eligibility counter is untouched: pruning an information-free row must not retract a model that already earned activation.

const std::vector<uint64_t>& archivedKeys() const

Archive-pool row indices folded into the neighborhood beyond the active training rows (empty without an archive).