Loading...
Searching...
No Matches
ActiveGPPotential.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_ACTIVEGPPOTENTIAL_H_
6#define GPR_POTENTIALS_ACTIVEGPPOTENTIAL_H_
7
8#include <memory>
9
10#include "ActiveGP.h"
11#include "rgpot/Potential.hpp"
12
13namespace pot {
14
38class ActiveGPPotential final : public rgpot::PotentialBase {
39public:
41
45 ActiveGPPotential(std::shared_ptr<gpr::neb::ActiveLearningSession> session,
46 std::shared_ptr<rgpot::PotentialBase> oracle,
47 Config config = Config());
48
51 std::tuple<double, rgpot::types::AtomMatrix, double> operator()(
52 const rgpot::types::AtomMatrix& positions,
53 const std::vector<int>& atmtypes,
54 const std::array<std::array<double, 3>, 3>& box) override;
55
58 [[nodiscard]] std::uint64_t modelState() const noexcept
59 {
60 return surrogate_.modelState();
61 }
62
63 [[nodiscard]] long oracleCalls() const noexcept
64 {
65 return surrogate_.oracleCalls();
66 }
67
68 [[nodiscard]] long trainingSize() const noexcept
69 {
70 return surrogate_.trainingSize();
71 }
72
75 {
76 surrogate_.incorporate();
77 }
78
82 ActiveGP& surrogate() noexcept
83 {
84 return surrogate_;
85 }
86
87private:
88 std::shared_ptr<rgpot::PotentialBase> oracle_;
89 ActiveGP surrogate_;
90};
91
92} // namespace pot
93
94#endif
long trainingSize() const noexcept
std::uint64_t modelState() const noexcept
ActiveGPPotential(std::shared_ptr< gpr::neb::ActiveLearningSession > session, std::shared_ptr< rgpot::PotentialBase > oracle, Config config=Config())
ActiveGP & surrogate() noexcept
std::tuple< double, rgpot::types::AtomMatrix, double > operator()(const rgpot::types::AtomMatrix &positions, const std::vector< int > &atmtypes, const std::array< std::array< double, 3 >, 3 > &box) override
void incorporate()
Host-declared incorporation boundary.
long oracleCalls() const noexcept
Potential wrappers and the batched oracle interface.