Loading...
Searching...
No Matches
StudentTProcessRegression.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
22
23#ifndef GPR_ML_STUDENTTPROCESSREGRESSION_H_
24#define GPR_ML_STUDENTTPROCESSREGRESSION_H_
25
27
28namespace gpr {
29
31public:
33 ~StudentTProcessRegression() override = default;
34
38 [[nodiscard]] bool exactNlmlHessianVectorAvailable() const noexcept override
39 {
40 return false;
41 }
42
43 [[nodiscard]] bool supportsRigidNullDeflation() const noexcept override
44 {
45 return false;
46 }
47
57 void setHyperpriorParameters(double a, double b);
58
59 double getHyperpriorA() const
60 {
61 return hp_a_;
62 }
63 double getHyperpriorB() const
64 {
65 return hp_b_;
66 }
67
73 double getTPPrefactor() const
74 {
75 return tp_prefactor_;
76 }
77
78 void calculateVariance(Observation& image1) override;
79
80protected:
88 double evaluateEnergy(const EigenMatrix& x, const Eigen::VectorXd& x_ind,
89 const Eigen::VectorXd& y) override;
90
98 double hyperparameterDataTermScale() const override;
99 void recordHyperparameterDataTerm(double rows, double quadratic) override;
100
101 bool hyperparameterEnergyIsGaussian() const override
102 {
103 return false;
104 }
105
106 void refreshVariancePrefactor(const Eigen::VectorXd& y_train) override;
108 const Eigen::VectorXd& y_train,
109 const Eigen::VectorXd& b_local) const override;
111 const Eigen::VectorXd& y_train, double y_dot_alpha) const override;
112
113private:
114 double hp_a_ = 1e-20;
115 double hp_b_ = 1e-20;
116 double tp_prefactor_ = 1.0;
117 double data_rows_ = 0.0;
118 double data_quadratic_ = 0.0;
119};
120
121} // namespace gpr
122
123#endif // GPR_ML_STUDENTTPROCESSREGRESSION_H_
@ x
Definition Enums.h:28
@ y
Definition Enums.h:28
double hyperparameterDataTermScale() const override
Weight of the data term in the Student-t gradient.
void recordHyperparameterDataTerm(double rows, double quadratic) override
~StudentTProcessRegression() override=default
void refreshVariancePrefactor(const Eigen::VectorXd &y_train) override
Hook called inside calculateVarianceLaplace at each CCD grid point, right after calculateMeanPredicti...
void setHyperpriorParameters(double a, double b)
Set the inverse-gamma hyperprior parameters.
double getTPPrefactor() const
TP prefactor (signal variance estimate from hyperprior).
bool exactNlmlHessianVectorAvailable() const noexcept override
double localVariancePrefactor(const Eigen::VectorXd &y_train, const Eigen::VectorXd &b_local) const override
double evaluateEnergy(const EigenMatrix &x, const Eigen::VectorXd &x_ind, const Eigen::VectorXd &y) override
Evaluate the Student-t negative log marginal posterior.
bool supportsRigidNullDeflation() const noexcept override
void calculateVariance(Observation &image1) override
Compute predictive variance for energy and gradient. Corresponds to MATLAB get_variance....
double localVariancePrefactorFromQuadratic(const Eigen::VectorXd &y_train, double y_dot_alpha) const override
bool hyperparameterEnergyIsGaussian() const override
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
Eigen::Matrix< double, EigenDynamic, EigenDynamic, EigenMatrixStorage > EigenMatrix
Definition Macros.h:20
Observation data: energy, gradient and positions.