class gpr::linalg::KokkosMolecularPosterior¶
Overview¶
Device-owned inverse-distance GP. More…
#include <gpr/linalg/KokkosMolecularPosterior.h>
class KokkosMolecularPosterior {
public:
// structs
struct Impl;
// construction
KokkosMolecularPosterior(const AtomsConfiguration& configuration, double far_radius = 0.0);
KokkosMolecularPosterior(const KokkosMolecularPosterior&);
~KokkosMolecularPosterior();
// methods
KokkosMolecularPosterior& operator=(const KokkosMolecularPosterior&);
bool matchesConfiguration(const AtomsConfiguration& configuration, double far_radius) const;
double condition(const EigenMatrix& rows, const Eigen::VectorXd& channels, const Eigen::VectorXd& targets, const Eigen::VectorXd& noise, const Eigen::VectorXd& lengths, double magnitude, double constant, double relative_nugget, double jitter, bool append_only = false);
bool canAppend(Eigen::Index geometries, const Eigen::VectorXd& noise, const Eigen::VectorXd& lengths, double magnitude, double constant, double jitter) const;
std::array<double, 2> objectiveParts();
Eigen::VectorXd downloadInverseDiagonal();
Eigen::VectorXd gradient(double differentiable_noise = 0.0, double data_term_scale = 1.0);
Eigen::VectorXd gradient(double differentiable_noise, const std::vector<int>& type_group, const std::vector<int>& group_slot, double data_term_scale = 1.0);
void predict(const EigenMatrix& rows, const Eigen::VectorXd& channels, Eigen::VectorXd* mean, Eigen::VectorXd* variance, bool stable_variance = false);
void setTargets(const Eigen::VectorXd& targets);
bool valid() const;
Eigen::Index order() const;
std::shared_ptr<const KokkosFactor> factorHandle() const;
EigenMatrix downloadFactor() const;
Eigen::VectorXd downloadAlpha() const;
Eigen::VectorXd downloadFactorDiagonal() const;
const EigenMatrix& trainingRows() const;
bool matchesTraining(const EigenMatrix& rows, const Eigen::VectorXd& channels, const Eigen::VectorXd& noise, const Eigen::VectorXd& lengths, double magnitude, double constant, double nugget, double jitter) const;
KokkosMolecularStats stats() const;
};
Detailed Documentation¶
Device-owned inverse-distance GP. Coordinates, targets and noise enter through host input boundaries; predictions and scalar fit derivatives leave through output boundaries. Descriptors, joint covariances, factors, coefficients and objective weights stay in the execution memory space.
Methods¶
bool canAppend(Eigen::Index geometries, const Eigen::VectorXd& noise, const Eigen::VectorXd& lengths, double magnitude, double constant, double jitter) const
log magnitude, then log length of each pair type; optional log noise.
Eigen::VectorXd gradient(double differentiable_noise, const std::vector<int>& type_group, const std::vector<int>& group_slot, double data_term_scale = 1.0)
The same gradient with the pair types of one length scale contracted together. type_group[t] is the group of pair type t, groups numbered from zero; the caller holds the lengths of a group equal. group_slot[g] is the pair type whose entry receives the derivative of group g, or -1 to drop it; every other length entry is zero.
bool matchesTraining(const EigenMatrix& rows, const Eigen::VectorXd& channels, const Eigen::VectorXd& noise, const Eigen::VectorXd& lengths, double magnitude, double constant, double nugget, double jitter) const
True when conditioning on exactly these inputs would reuse the resident factor unchanged.