GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
GprMeanPotential.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) gpridge developers
3
// See LICENSE for details.
4
5
#ifndef GPR_POTENTIALS_GPRMEANPOTENTIAL_H_
6
#define GPR_POTENTIALS_GPRMEANPOTENTIAL_H_
7
8
#include <cstdint>
9
#include <memory>
10
#include <vector>
11
12
#include "
PotentialWrapper.h
"
13
#include "
gpr/ml/GaussianProcessRegression.h
"
14
#include "rgpot/Potential.hpp"
15
16
namespace
gpr
{
17
namespace
neb
{
18
class
ActiveLearningSession
;
19
}
20
}
// namespace gpr
21
22
namespace
pot
{
23
31
class
GprMeanPotential
:
public
rgpot::Potential<GprMeanPotential> {
32
public
:
33
using
rgpot::Potential<
GprMeanPotential
>
::forceBatch
;
34
35
explicit
GprMeanPotential
(
gpr::GaussianProcessRegression
& model);
36
explicit
GprMeanPotential
(
37
std::shared_ptr<gpr::GaussianProcessRegression> model);
38
explicit
GprMeanPotential
(
gpr::neb::ActiveLearningSession
& session);
39
void
resetModel
(std::shared_ptr<gpr::GaussianProcessRegression> model);
40
41
[[nodiscard]] std::uint64_t
surfaceEpoch
()
const
noexcept
;
42
[[nodiscard]] std::uint64_t
paramsKey
()
const
noexcept
override
;
43
[[nodiscard]] rgpot::PotCaps
caps
()
const
noexcept
override
;
44
void
forceImpl
(
const
rgpot::ForceInput& in,
45
rgpot::ForceOut*
out
)
const override
;
46
void
hessianVectorImpl
(
const
rgpot::ForceInput& in,
const
double
* direction,
47
double
* action)
const
;
48
49
void
force
(
long
N,
const
double
* R,
const
int
* atomicNrs,
double
* F,
50
double
* U,
double
* variance,
const
double
* box);
51
52
void
forceBatch
(
long
N, std::size_t B,
const
double
* R,
53
const
int
* atomicNrs,
double
* F,
double
* U,
54
const
double
* box);
55
56
[[nodiscard]]
PotentialWrapper
asWrapper
();
57
58
private
:
59
std::shared_ptr<gpr::GaussianProcessRegression> owned_model_;
60
std::uint64_t epoch_base_ = 0;
61
std::uint64_t base_factor_epoch_ = 0;
62
gpr::GaussianProcessRegression
* model_ =
nullptr
;
63
gpr::neb::ActiveLearningSession
* session_ =
nullptr
;
64
65
[[nodiscard]]
gpr::GaussianProcessRegression
& model();
66
[[nodiscard]]
const
gpr::GaussianProcessRegression
& model()
const
;
67
void
validateSystem(
long
N,
const
int
* atomicNrs,
const
double
* box,
68
const
char
* caller)
const
;
69
};
70
71
}
// namespace pot
72
73
#endif
GaussianProcessRegression.h
PotentialWrapper.h
gpr::GaussianProcessRegression
Definition
GaussianProcessRegression.h:335
pot::GprMeanPotential::paramsKey
std::uint64_t paramsKey() const noexcept override
Definition
GprMeanPotential.cpp:78
pot::GprMeanPotential::hessianVectorImpl
void hessianVectorImpl(const rgpot::ForceInput &in, const double *direction, double *action) const
Definition
GprMeanPotential.cpp:100
pot::GprMeanPotential::caps
rgpot::PotCaps caps() const noexcept override
Definition
GprMeanPotential.cpp:83
pot::GprMeanPotential::asWrapper
PotentialWrapper asWrapper()
Definition
GprMeanPotential.cpp:264
pot::GprMeanPotential::force
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box)
Definition
GprMeanPotential.cpp:199
pot::GprMeanPotential::resetModel
void resetModel(std::shared_ptr< gpr::GaussianProcessRegression > model)
Definition
GprMeanPotential.cpp:40
pot::GprMeanPotential::forceImpl
void forceImpl(const rgpot::ForceInput &in, rgpot::ForceOut *out) const override
Definition
GprMeanPotential.cpp:88
pot::GprMeanPotential::surfaceEpoch
std::uint64_t surfaceEpoch() const noexcept
Definition
GprMeanPotential.cpp:67
pot::GprMeanPotential::forceBatch
void forceBatch(long N, std::size_t B, const double *R, const int *atomicNrs, double *F, double *U, const double *box)
Definition
GprMeanPotential.cpp:233
pot::GprMeanPotential::GprMeanPotential
GprMeanPotential(gpr::GaussianProcessRegression &model)
Definition
GprMeanPotential.cpp:20
pot::PotentialWrapper
Type-erased wrapper around any potential that provides a force() interface.
Definition
PotentialWrapper.h:94
out
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
Definition
eon_relax_engine.h:240
gpr::neb
The nudged elastic band: path, GP-NEB driver, configuration and result, acquisition,...
Definition
ChainRealign.h:29
gpr
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition
Macros.h:16
pot
Potential wrappers and the batched oracle interface.
Definition
ProblemSetUp.h:22
gpr::neb::ActiveLearningSession
Definition
Session.h:198
gpr
potentials
GprMeanPotential.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf