#include <Eigen/Dense>#include <optional>#include <string>#include <vector>#include "GaussianProcessRegression.h"Go to the source code of this file.
Classes | |
| struct | gpr::posterior::DerivativeOptions |
| Options for batched posterior derivative primitives. More... | |
| struct | gpr::posterior::DerivativeReport |
| Report returned by a batched posterior derivative primitive. More... | |
Namespaces | |
| namespace | gpr |
| Gaussian-process regression, kernels, priors, and the searches that run on the surrogate. | |
| namespace | gpr::posterior |
Typedefs | |
| using | gpr::posterior::HessianAction |
| Exact Hessian-vector-product callback at a fixed point: writes H(x) * v into hv and returns true on success. | |
Enumerations | |
| enum class | gpr::posterior::DerivativeStatus { gpr::posterior::Ok , gpr::posterior::InvalidArgument , gpr::posterior::NotTrained , gpr::posterior::Unsupported , gpr::posterior::OutOfSupport } |
| Outcome of a derivative primitive. The C API maps each value to one status code; nothing here returns a NaN in place of a failure. More... | |
| enum class | gpr::posterior::EnergyUnit { gpr::posterior::Native = 0 , gpr::posterior::Ev = 1 , gpr::posterior::Hartree = 2 , gpr::posterior::KcalPerMol = 3 , gpr::posterior::KjPerMol = 4 } |
| Unit tags carried through the primitives. They name the units the GP was trained in; no value is converted. More... | |
| enum class | gpr::posterior::LengthUnit { gpr::posterior::Native = 0 , gpr::posterior::Angstrom = 1 , gpr::posterior::Bohr = 2 , gpr::posterior::Nanometer = 3 } |
| Length unit tags carried through the derivative primitives. More... | |
Functions | |
| constexpr double | gpr::posterior::defaultVarianceStep () noexcept |
| Default finite-difference step for posterior curvature variance. | |
| std::optional< double > | gpr::posterior::roundoffVariance (double variance, double prior_scale) noexcept |
| variance when it is finite and nonnegative, zero when it is negative by at most kNegativeVarianceTolerance * prior_scale, and empty otherwise. An empty result is refused with Unsupported by every primitive: a materially negative variance is never in support and never a converged spread. A prior_scale that is not finite and positive admits no negative value. | |
| Eigen::MatrixXd | gpr::posterior::rigidGenerators (const Eigen::VectorXd &positions) |
| Unit rigid generators of 3N coordinates as columns: three translations, then rotations about the x, y and z axes through the centroid. A rotation that does not move any atom (one atom, or an axis a linear geometry lies on) is a zero column. | |
| Eigen::MatrixXd | gpr::posterior::rigidProjector (const Eigen::VectorXd &positions, const AtomsConfiguration &config) |
| Orthogonal projector onto the physical vibrational complement of the rigid motions of positions under config. | |
| Eigen::MatrixXd | gpr::posterior::rigidProjector (const Eigen::VectorXd &positions) |
| I - Q Q^T for an orthonormal basis Q of the nonzero rigid generators. | |
| DerivativeReport | gpr::posterior::meanHessians (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const DerivativeOptions &options, std::vector< Eigen::MatrixXd > &hessians, Eigen::MatrixXd *residuals=nullptr) |
| Full posterior-mean Hessians at the rows of points, symmetrized. residuals, when given, receives one row per point: ||H t|| for the six unit generators of rigidGenerators, -1 where a generator vanishes. | |
| DerivativeReport | gpr::posterior::meanHessianActions (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const std::vector< Eigen::MatrixXd > &directions, const DerivativeOptions &options, std::vector< Eigen::MatrixXd > &actions) |
| Posterior-mean Hessian actions. directions[b] holds k rows, each one vector at point b; actions[b] receives H(x_b) v as the same k rows. | |
| DerivativeReport | gpr::posterior::hessianBilinearCovariance (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const std::vector< Eigen::MatrixXd > &left, const std::vector< Eigen::MatrixXd > &right, const DerivativeOptions &options, std::vector< Eigen::MatrixXd > &covariance) |
| Posterior covariance of M_ij = v_i^T H w_j at each point. left[b] holds the v_i as rows and right[b] the w_j. covariance[b] is (kl kr)^2 with entry index i * kr + j. The curvature is the central difference of the posterior gradient process along each w_j, so this is the covariance of that stencil: a probabilistic estimate with O(h^2) truncation in variance_step, not a bound. Forms the 2 kr (d + 1) joint posterior covariance block per point (O(kr^2 d^2) memory). The three Hessian uncertainty functions refuse with Unsupported, outputs untouched, when a result overflows, is NaN, or flushes a nonzero value below the normal double range (direction norms far from 1 scale it by their fourth power). | |
| DerivativeReport | gpr::posterior::hessianBilinearVariances (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const std::vector< Eigen::MatrixXd > &directions, const DerivativeOptions &options, std::vector< Eigen::VectorXd > &variances) |
| Diagonal posterior variances of v_i^T H v_i at each point. Computes one stencil functional at a time, avoiding a k^2 covariance matrix when callers need only each mode's variance. | |
| DerivativeReport | gpr::posterior::hessianTraceVariance (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const std::vector< Eigen::MatrixXd > &weights, const DerivativeOptions &options, Eigen::VectorXd &variances) |
| Posterior variance of tr(A dH) at each point for a symmetric A per point, the same estimate as hessianBilinearCovariance on the eigenvectors of A (O(rank(A)^2 d^2) joint-covariance memory). | |
| DerivativeReport | gpr::posterior::posteriorVariances (GaussianProcessRegression &gp, const Eigen::MatrixXd &points, const DerivativeOptions &options, Eigen::VectorXd &energy_variance, Eigen::MatrixXd &gradient_variance) |
| Posterior energy and gradient variance at the rows of points. | |
| DerivativeReport | gpr::posterior::conditionFixed (GaussianProcessRegression &gp, Observation &training, const Observation &added, const Eigen::MatrixXd &queries, const DerivativeOptions &options, Eigen::VectorXd &energy, Eigen::MatrixXd &gradient, Eigen::VectorXd &energy_variance, Eigen::MatrixXd &gradient_variance) |
| Condition the fitted posterior on the rows of added at its current hyperparameters, then predict mean and variance at queries. The training factor is bordered in place when the backend allows it and refactored at the same hyperparameters otherwise; the report says which. Neither refits a hyperparameter. training is the observation set the posterior was fitted on; it is extended whenever the rows are taken, including an OutOfSupport return for the queries. | |
| DerivativeReport | gpr::posterior::conditionFixed (GaussianProcessRegression &gp, Observation &training, const Observation &added, const Eigen::MatrixXd *fixed_hessian, const HessianAction *hvp, const Eigen::MatrixXd &queries, const DerivativeOptions &options, Eigen::VectorXd &energy, Eigen::MatrixXd &gradient, Eigen::VectorXd &energy_variance, Eigen::MatrixXd &gradient_variance) |
| Condition on added and optionally record an exact Hessian or Hessian-vector-product callback at the fixed point (added.R.rows() == 1). An invalid shape, non-finite entry, or asymmetric Hessian / HVP is rejected with DerivativeStatus::InvalidArgument before mutating gp or training (no silent fallback to GP curvature). | |
| DerivativeReport | gpr::posterior::conditionFixed (GaussianProcessRegression &gp, Observation &training, const Observation &added, const Eigen::MatrixXd &fixed_hessian, const Eigen::MatrixXd &queries, const DerivativeOptions &options, Eigen::VectorXd &energy, Eigen::MatrixXd &gradient, Eigen::VectorXd &energy_variance, Eigen::MatrixXd &gradient_variance) |
| Condition on added and record an exact Hessian at the fixed point. | |
| DerivativeReport | gpr::posterior::conditionFixed (GaussianProcessRegression &gp, Observation &training, const Observation &added, const HessianAction &hvp, const Eigen::MatrixXd &queries, const DerivativeOptions &options, Eigen::VectorXd &energy, Eigen::MatrixXd &gradient, Eigen::VectorXd &energy_variance, Eigen::MatrixXd &gradient_variance) |
| Condition on added and record an HVP callback at the fixed point. | |
| void | gpr::posterior::setConditionedHessian (GaussianProcessRegression &gp, const Eigen::VectorXd &point, const Eigen::MatrixXd &hessian) |
| Record a user-supplied exact Hessian conditioned at point. | |
| void | gpr::posterior::clearConditionedHessians (GaussianProcessRegression &gp) noexcept |
| Clear all conditioned exact Hessians stored on gp. | |
| bool | gpr::posterior::findConditionedHessian (const GaussianProcessRegression &gp, const Eigen::VectorXd &point, Eigen::MatrixXd &hessian_out) |
| Look up a conditioned exact Hessian at point. | |
Variables | |
| constexpr double | gpr::posterior::kNegativeVarianceTolerance = 0x1p-26 |
| Relative tolerance under which a negative posterior variance is binary64 round-off. | |