class gpr::AtomicInducingPosterior¶
Overview¶
Variational posterior of an additive atomic energy, conditioned on complete energy and Cartesian-gradient observations. More…
#include <gpr/ml/AtomicInducingPosterior.h>
class AtomicInducingPosterior {
public:
// structs
struct Basis;
struct Impl;
struct Objective;
// construction
AtomicInducingPosterior(std::shared_ptr<const linalg::MpiCommunicator> communication = {});
AtomicInducingPosterior(AtomicInducingPosterior&&);
AtomicInducingPosterior(const AtomicInducingPosterior&);
~AtomicInducingPosterior();
// methods
AtomicInducingPosterior& operator=(AtomicInducingPosterior&&);
AtomicInducingPosterior& operator=(const AtomicInducingPosterior&);
void prepare(const Observation& observations, SpeciesEnvironmentKernel::Descriptor descriptor, Basis basis, double inducing_relative_jitter = 0.0, std::optional<double> energy_reference = std::nullopt, SpeciesEnvironmentKernel::Descriptor values_descriptor = {}, SpeciesEnvironmentKernel::SupportedDescriptor supported_descriptor = {});
const std::vector<int>& parameterSpecies() const;
Eigen::VectorXd initialParameters(double magnitude_variance, const SpeciesEnvironmentKernel::LengthScales& lengths, double energy_noise_variance, double gradient_noise_variance) const;
Objective evaluate(const Eigen::VectorXd& log_theta) const;
bool fit(const Eigen::VectorXd& log_theta);
bool built() const;
void invalidate();
Eigen::Index observationCount() const;
Eigen::Index inducingCount() const;
std::size_t cachedJacobianElements() const;
double inverseCartesianLengthScale(const Eigen::VectorXd& position) const;
void calculatePotential(Observation& image) const;
void calculateVariance(Observation& image) const;
void calculateEnergyVariance(const EigenMatrix& positions, Eigen::RowVectorXd& variance) const;
void calculateCovariance(const EigenMatrix& positions, EigenMatrix& covariance) const;
double functionalVariance(const EigenMatrix& positions, const Eigen::VectorXd& weights) const;
};
Detailed Documentation¶
Variational posterior of an additive atomic energy, conditioned on complete energy and Cartesian-gradient observations. Only inducing-size matrices are factored. The fixed descriptor basis is independent of the physical atoms.
Methods¶
void prepare(const Observation& observations, SpeciesEnvironmentKernel::Descriptor descriptor, Basis basis, double inducing_relative_jitter = 0.0, std::optional<double> energy_reference = std::nullopt, SpeciesEnvironmentKernel::Descriptor values_descriptor = {}, SpeciesEnvironmentKernel::SupportedDescriptor supported_descriptor = {})
Collective on the supplied process group. Owns the complete raw data, descriptor and inducing centers; each rank caches its configuration slab. An omitted energy reference selects the first measured energy. Jitter is a fixed nonnegative fraction of the atomic kernel’s magnitude variance. A values-only descriptor must return the same species and features as descriptor; when omitted, energy queries use descriptor. A supplied supported descriptor replaces the dense descriptor for full queries and training. Its sorted unique row indices retain the complete Cartesian dimension; the dense descriptor may then be empty.
const std::vector<int>& parameterSpecies() const
Parameter order: log magnitude variance, sorted species log lengths, log energy noise variance, log gradient noise variance.
Objective evaluate(const Eigen::VectorXd& log_theta) const
Collective variational negative log evidence and its exact derivatives. Invalid numerical parameters return infinity and a nonfinite gradient.
bool fit(const Eigen::VectorXd& log_theta)
Collective conditioning at the supplied parameters, without optimization. A rejected fit invalidates the prediction state.
std::size_t cachedJacobianElements() const
Stored Jacobian coefficients in this rank’s training cache. Rows that are identically zero occupy no coefficient storage.
double inverseCartesianLengthScale(const Eigen::VectorXd& position) const
Maximum descriptor Jacobian Frobenius norm divided by its fitted species length. The bound includes coordinates orthogonal to a query direction and supplies a Cartesian finite-difference scale.
void calculatePotential(Observation& image) const
Queries are rank-local. They return physical energy/gradient units and include all moving Cartesian coordinates, with E shaped 1-by-N and G shaped N-by-D. Variance is latent: observation noise is absent, and the unresolved prior covariance K-Q is retained.
void calculateEnergyVariance(const EigenMatrix& positions, Eigen::RowVectorXd& variance) const
Energy marginals use descriptor values and one inducing row per query, without assembling Cartesian-gradient rows or covariance terms.
void calculateCovariance(const EigenMatrix& positions, EigenMatrix& covariance) const
Joint layout: every energy, followed by each Cartesian gradient column.