.. index:: pair: class; gpr::AtomicInducingPosterior .. _doxid-classgpr_1_1_atomic_inducing_posterior: class gpr::AtomicInducingPosterior ================================== .. toctree:: :hidden: struct_gpr_AtomicInducingPosterior_Basis.rst struct_gpr_AtomicInducingPosterior_Impl.rst struct_gpr_AtomicInducingPosterior_Objective.rst Overview ~~~~~~~~ Variational posterior of an additive atomic energy, conditioned on complete energy and Cartesian-gradient observations. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class AtomicInducingPosterior { public: // structs struct :ref:`Basis`; struct :ref:`Impl`; struct :ref:`Objective`; // construction :target:`AtomicInducingPosterior`(std::shared_ptr`> communication = {}); :target:`AtomicInducingPosterior`(AtomicInducingPosterior&&); :target:`AtomicInducingPosterior`(const AtomicInducingPosterior&); :target:`~AtomicInducingPosterior`(); // methods :ref:`AtomicInducingPosterior`& :target:`operator=`(:ref:`AtomicInducingPosterior`&&); :ref:`AtomicInducingPosterior`& :target:`operator=`(const :ref:`AtomicInducingPosterior`&); void :ref:`prepare`(const :ref:`Observation`& observations, :ref:`SpeciesEnvironmentKernel::Descriptor` descriptor, :ref:`Basis` basis, double inducing_relative_jitter = 0.0, std::optional energy_reference = std::nullopt, :ref:`SpeciesEnvironmentKernel::Descriptor` values_descriptor = {}, :ref:`SpeciesEnvironmentKernel::SupportedDescriptor` supported_descriptor = {}); const std::vector& :ref:`parameterSpecies`() const; Eigen::VectorXd :target:`initialParameters`(double magnitude_variance, const :ref:`SpeciesEnvironmentKernel::LengthScales`& lengths, double energy_noise_variance, double gradient_noise_variance) const; :ref:`Objective` :ref:`evaluate`(const Eigen::VectorXd& log_theta) const; bool :ref:`fit`(const Eigen::VectorXd& log_theta); bool :target:`built`() const; void :target:`invalidate`(); Eigen::Index :target:`observationCount`() const; Eigen::Index :target:`inducingCount`() const; std::size_t :ref:`cachedJacobianElements`() const; double :ref:`inverseCartesianLengthScale`(const Eigen::VectorXd& position) const; void :ref:`calculatePotential`(:ref:`Observation`& image) const; void :target:`calculateVariance`(:ref:`Observation`& image) const; void :ref:`calculateEnergyVariance`(const :ref:`EigenMatrix`& positions, Eigen::RowVectorXd& variance) const; void :ref:`calculateCovariance`(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& covariance) const; double :target:`functionalVariance`(const :ref:`EigenMatrix`& positions, const Eigen::VectorXd& weights) const; }; .. _details-classgpr_1_1_atomic_inducing_posterior: 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 ------- .. index:: pair: function; prepare .. _doxid-classgpr_1_1_atomic_inducing_posterior_1a492f84ffac77144d4ecda8c17fc94c54: .. ref-code-block:: cpp :class: doxyrest-title-code-block void prepare(const :ref:`Observation`& observations, :ref:`SpeciesEnvironmentKernel::Descriptor` descriptor, :ref:`Basis` basis, double inducing_relative_jitter = 0.0, std::optional energy_reference = std::nullopt, :ref:`SpeciesEnvironmentKernel::Descriptor` values_descriptor = {}, :ref:`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. .. index:: pair: function; parameterSpecies .. _doxid-classgpr_1_1_atomic_inducing_posterior_1aa06dd77452349b88835b9abb0feb681d: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::vector& parameterSpecies() const Parameter order: log magnitude variance, sorted species log lengths, log energy noise variance, log gradient noise variance. .. index:: pair: function; evaluate .. _doxid-classgpr_1_1_atomic_inducing_posterior_1abd63fb8146a16af48c74a447a1aef15d: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`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. .. index:: pair: function; fit .. _doxid-classgpr_1_1_atomic_inducing_posterior_1a1e3efd39225adb21394db5d9561205fa: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool fit(const Eigen::VectorXd& log_theta) Collective conditioning at the supplied parameters, without optimization. A rejected fit invalidates the prediction state. .. index:: pair: function; cachedJacobianElements .. _doxid-classgpr_1_1_atomic_inducing_posterior_1a7ce30d0083a4161d67080a4b47041d8c: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t cachedJacobianElements() const Stored Jacobian coefficients in this rank's training cache. Rows that are identically zero occupy no coefficient storage. .. index:: pair: function; inverseCartesianLengthScale .. _doxid-classgpr_1_1_atomic_inducing_posterior_1a1f5bed14339c8f05d7db81d6a382fae0: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. index:: pair: function; calculatePotential .. _doxid-classgpr_1_1_atomic_inducing_posterior_1af978859c137e57da7e6651f64037e5aa: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculatePotential(:ref:`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. .. index:: pair: function; calculateEnergyVariance .. _doxid-classgpr_1_1_atomic_inducing_posterior_1af3e6e523d5b8ac267fa54738c823987e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateEnergyVariance(const :ref:`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. .. index:: pair: function; calculateCovariance .. _doxid-classgpr_1_1_atomic_inducing_posterior_1a715e58f9faf740cd52bc3c7e7a7ddf84: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateCovariance(const :ref:`EigenMatrix`& positions, :ref:`EigenMatrix`& covariance) const Joint layout: every energy, followed by each Cartesian gradient column.