GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
DerivativeVecchia.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) gpridge developers
3
//
4
// Derivative-aware Vecchia approximation for a gradient-enhanced GP.
5
// TERA: Scalable Derivative Gaussian Processes via Exact Gradient Reduction,
6
// DOI 10.48550/arxiv.2606.02909.
7
//
8
// The global kernel of a gradient-enhanced GP is n(d+1) square and, on a flat
9
// spectrum, badly conditioned. Vecchia factors the joint density into ordered
10
// conditionals and keeps only a few predecessors in each,
11
//
12
// p(y) ~ prod_i p(y_i | y_{N(i)}), |N(i)| <= m,
13
//
14
// so one global solve becomes n local solves of size (|N(i)| + 1)(d + 1).
15
// Each local block inherits only the conditioning of its own neighbourhood,
16
// which is what makes the approximation attractive where the global matrix is
17
// the problem rather than its size.
18
//
19
// Every point here carries a value AND its d gradient components, and they are
20
// kept together: splitting a point's derivative rows across different
21
// conditioning sets would condition a gradient on its own value through a
22
// different path than the value takes, which is not a valid factorization of
23
// the joint density.
24
//
25
// Exactness at full conditioning is the property to hold onto: with
26
// N(i) = {0..i-1} the factorization is the joint density itself, so the
27
// approximate log-determinant and quadratic form must equal the exact ones.
28
// That is what the tests pin, and it is what tells an approximation error from
29
// a bug.
30
31
#ifndef GPR_ML_GP_DERIVATIVE_VECCHIA_H_
32
#define GPR_ML_GP_DERIVATIVE_VECCHIA_H_
33
34
#include <Eigen/Core>
35
#include <cstddef>
36
#include <vector>
37
38
namespace
gpr
{
39
namespace
vecchia
{
40
42
struct
VecchiaResult
{
43
double
log_determinant
= 0.0;
44
double
quadratic_form
= 0.0;
45
std::size_t
largest_local_solve
= 0;
46
std::size_t
total_local_rows
= 0;
47
bool
valid
=
false
;
48
};
49
52
[[nodiscard]] std::vector<std::vector<int>>
nearestPredecessors
(
53
const
Eigen::MatrixXd& points,
int
max_neighbours);
54
63
[[nodiscard]]
VecchiaResult
evaluate
(
const
Eigen::MatrixXd& points,
64
const
Eigen::VectorXd&
y
,
65
double
lengthscale,
double
noise,
66
int
max_neighbours);
67
70
[[nodiscard]]
VecchiaResult
evaluateExact
(
const
Eigen::MatrixXd& points,
71
const
Eigen::VectorXd&
y
,
72
double
lengthscale,
double
noise);
73
75
[[nodiscard]] Eigen::MatrixXd
jointBlock
(
const
Eigen::VectorXd& a,
76
const
Eigen::VectorXd& b,
77
double
lengthscale);
78
79
}
// namespace vecchia
80
}
// namespace gpr
81
82
#endif
// GPR_ML_GP_DERIVATIVE_VECCHIA_H_
y
@ y
Definition
Enums.h:28
gpr::vecchia
Definition
DerivativeVecchia.cpp:13
gpr::vecchia::jointBlock
Eigen::MatrixXd jointBlock(const Eigen::VectorXd &a, const Eigen::VectorXd &b, double lengthscale)
The joint value/gradient kernel block between two points, (1+d) x (1+d).
Definition
DerivativeVecchia.cpp:15
gpr::vecchia::evaluate
VecchiaResult evaluate(const Eigen::MatrixXd &points, const Eigen::VectorXd &y, double lengthscale, double noise, int max_neighbours)
Definition
DerivativeVecchia.cpp:105
gpr::vecchia::nearestPredecessors
std::vector< std::vector< int > > nearestPredecessors(const Eigen::MatrixXd &points, int max_neighbours)
Definition
DerivativeVecchia.cpp:76
gpr::vecchia::evaluateExact
VecchiaResult evaluateExact(const Eigen::MatrixXd &points, const Eigen::VectorXd &y, double lengthscale, double noise)
Definition
DerivativeVecchia.cpp:172
gpr
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition
Macros.h:16
gpr::vecchia::VecchiaResult
What the approximation produced, and what it cost.
Definition
DerivativeVecchia.h:42
gpr::vecchia::VecchiaResult::log_determinant
double log_determinant
sum of local conditional log-dets
Definition
DerivativeVecchia.h:43
gpr::vecchia::VecchiaResult::total_local_rows
std::size_t total_local_rows
summed local work
Definition
DerivativeVecchia.h:46
gpr::vecchia::VecchiaResult::valid
bool valid
false when a local block was not factorizable
Definition
DerivativeVecchia.h:47
gpr::vecchia::VecchiaResult::largest_local_solve
std::size_t largest_local_solve
rows in the biggest local system
Definition
DerivativeVecchia.h:45
gpr::vecchia::VecchiaResult::quadratic_form
double quadratic_form
y^T K^{-1} y, summed over conditionals
Definition
DerivativeVecchia.h:44
gpr
ml
gp
DerivativeVecchia.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf