namespace gpr

Overview

namespace gpr {
 
// namespaces
 
namespace gpr::coord;
namespace gpr::field;
namespace gpr::io;
namespace gpr::laplace;
namespace gpr::linalg;
    namespace gpr::linalg::detail;
namespace gpr::neb;
namespace gpr::optim;
namespace gpr::potentials;
namespace gpr::priors;
namespace gpr::sfc;
namespace gpr::tests;
 
// typedefs
 
typedef uint32_t Index_t;
typedef Eigen::Matrix<double, EigenDynamic, EigenDynamic, EigenMatrixStorage> EigenMatrix;
typedef Eigen::Matrix<double, EigenDynamic, EigenDynamic, FieldMatrixStorage> FieldMatrixd;
typedef Eigen::Matrix<int, EigenDynamic, EigenDynamic, FieldMatrixStorage> FieldMatrixi;
typedef Eigen::Matrix<Index_t, EigenDynamic, EigenDynamic, FieldMatrixStorage> FieldMatrixIdx;
typedef Eigen::Matrix<uint8_t, EigenDynamic, EigenDynamic, FieldMatrixStorage> FieldMatrixU8;
typedef FieldMatrixd Coord;
typedef Eigen::Vector3d vector3_reg;
typedef std::function<EigenMatrix(const std::vector<double>&lengthscales, double noise)> KernelMatrixBuilder;
 
// enums
 
enum HyperparameterOptimizationMode;
enum ScgCurvatureMode;
enum UncertaintyMode;
 
// structs
 
struct ARDSearchResult;
struct AdamOptimizationSettings;
struct AtomsConfiguration;
struct AtomsPositionAndType;
struct BMAPrediction;
struct CeresOptimizationSettings;
 
template <typename T>
struct Derivatives;
 
struct EnergyAndGradient;
struct EnergySurfaceOutputInfo;
struct GPRSetup;
struct INLAPrediction;
struct Indices2D;
struct InputParameters;
struct IterationsLimits;
 
template <typename T>
struct KeyValuePair;
 
struct LBFGSInfo;
struct NoiseSearchResult;
struct Observation;
struct OptimizerCommonSettings;
 
template <typename T>
struct Pair;
 
struct ScgOptimizationSettings;
struct SexpatLocalOracleScope;
struct StopCriteriaForDimer;
struct StructuredPermutation;
struct TransitionParameters;
 
template <typename T>
struct Triplet;
 
// classes
 
class ARDGridSearch;
class BayesianModelAveraging;
class ConstantCF;
class FactorizedLikelihood;
class GaussianProcessRegression;
class InverseDistanceDescriptor;
class LaplaceINLA;
class LikGaussian;
class NoiseGridSearch;
class ObservationLikelihood;
class PriorBase;
class PriorGaussian;
class PriorLogNormal;
class PriorLogUnif;
class PriorSqrtt;
class PriorT;
class PriorUnif;
class RFFModel;
class RandomFourierFeatures;
class SexpatCF;
class StudentTProcessRegression;
class TrustRadius;
 
// global variables
 
auto EigenDynamic = Eigen::Dynamic;
auto EigenMatrixStorage = Eigen::StorageOptions::ColMajor;
auto FieldMatrixStorage = Eigen::StorageOptions::RowMajor;
thread_local bool sexpat_local_oracle_active = false;
 
// global functions
 
Eigen::VectorXd findFMode(const EigenMatrix& K, const Eigen::VectorXd& y, const ObservationLikelihood& ol, int max_iter = 30, double tol = 1e-8);
double laplaceMarginalLogLik(const EigenMatrix& K, const Eigen::VectorXd& y, const Eigen::VectorXd& f_mode, const ObservationLikelihood& ol);
StructuredPermutation buildStructuredPermutation(const Eigen::VectorXd& ind_Ddim);
StructuredPermutation buildObservationTiledPermutation(const Eigen::VectorXd& ind_Ddim);
Eigen::VectorXd permuteVector(const Eigen::VectorXd& input, const StructuredPermutation& p);
Eigen::VectorXd unpermuteVector(const Eigen::VectorXd& input, const StructuredPermutation& p);
EigenMatrix permuteMatrixRows(const EigenMatrix& input, const StructuredPermutation& p);
EigenMatrix unpermuteMatrixRows(const EigenMatrix& input, const StructuredPermutation& p);
EigenMatrix permuteSymmetricMatrix(const EigenMatrix& input, const StructuredPermutation& p);
EigenMatrix unpermuteSymmetricMatrix(const EigenMatrix& input, const StructuredPermutation& p);
 
} // namespace gpr

Detailed Documentation

Typedefs

typedef std::function<EigenMatrix(const std::vector<double>&lengthscales, double noise)> KernelMatrixBuilder

Kernel matrix builder: given lengthscales and noise, return K_XX.

Global Variables

thread_local bool sexpat_local_oracle_active = false

Thread-local switch for the local-oracle gradient region: when true the per-pair OpenMP pragma inside SexpatCF::calculateGradOfCov- MatrixWithDerivatives* activates. Set to true ONLY inside the SVGD per-particle oracle (which runs serial_per_rank=true with no MPI/ScaLAPACK collectives); SCG/MAP/Laplace paths leave it false so the distributed Cholesky doesn’t get nested OMP teams that would oversubscribe the host.

Global Functions

Eigen::VectorXd findFMode(const EigenMatrix& K, const Eigen::VectorXd& y, const ObservationLikelihood& ol, int max_iter = 30, double tol = 1e-8)

Posterior mode f_mode = argmax_f [log p(y|f) + log N(f | 0, K)] via the Rasmussen-Williams safe Newton recursion (Algo 3.1).

Uses the B = I + W^{1/2} K W^{1/2} parameterisation that avoids inverting K directly. Converges in O(log(1/tol)) iterations on log-concave likelihoods when K is well-conditioned.

Parameters:

K

Prior covariance; pass the K_theta at the current hyperparameters (WITHOUT noise added; noise lives in W).

y

Observations.

ol

Observation-likelihood contract (log-concave).

max_iter

Max Newton steps; throws if exceeded without |Delta f| < tol * max(1, |f|).

tol

Relative convergence tolerance.

Returns:

Converged f_mode, same size as y.

double laplaceMarginalLogLik(const EigenMatrix& K, const Eigen::VectorXd& y, const Eigen::VectorXd& f_mode, const ObservationLikelihood& ol)

Laplace approximation to log p(y | theta) given prior K and the converged posterior mode f_mode (R&W eq. 3.32):

log p(y|theta) ~= log p(y|f_mode) + log N(f_mode | 0, K)

  • (1/2) log|I + W K|

with W = diag(negHessDiag(y, f_mode)).