Loading...
Searching...
No Matches
GpState.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3#pragma once
4
5#include <string>
6
8
9namespace gpr {
12namespace neb {
14}
15
16namespace io {
17
26 double magn_sigma2 = 0.0;
27 double const_sigma2 = 0.0;
28 double sigma2 = 0.0;
29 double output_mean = 0.0;
30 double output_scale = 1.0;
31 bool output_mean_frozen = false;
32 double pair_cutoff = 0.0;
33 double pair_cutoff_width = 0.0;
35 bool has_pair_kernel = false;
36 std::string kernel_text;
37 std::string identity;
38};
39
41void saveTrainedGpState(const std::string& path,
43 const Observation& observations,
44 const AtomsConfiguration& atoms);
45
46[[nodiscard]] TrainedGpState loadTrainedGpState(const std::string& path);
47
49[[nodiscard]] TrainedGpState observationState(const Observation& observations);
50
55 const TrainedGpState& state,
56 const AtomsConfiguration& atoms,
57 bool require_identity);
58
62void refuseNonFiniteSeedRows(const Observation& observations,
63 Eigen::Index expected_cols = -1);
64
70 const TrainedGpState& state, bool require_identity,
71 Eigen::Index expected_cols = -1);
72
76[[nodiscard]] std::string resolveGpStatePath(const std::string& spec,
77 bool restart);
78
80[[nodiscard]] std::string outputDirectory(const std::string& output_path);
81
82} // namespace io
83} // namespace gpr
bool applyTrainedGpState(GaussianProcessRegression &gp, const TrainedGpState &state, const AtomsConfiguration &atoms, bool require_identity)
Definition GpState.cpp:564
std::string resolveGpStatePath(const std::string &spec, bool restart)
Definition GpState.cpp:694
void refuseNonFiniteSeedRows(const Observation &observations, Eigen::Index expected_cols)
Definition GpState.cpp:587
TrainedGpState observationState(const Observation &observations)
A state that carries observations and no pair kernel.
Definition GpState.cpp:556
TrainedGpState loadTrainedGpState(const std::string &path)
Definition GpState.cpp:516
void saveTrainedGpState(const std::string &path, const GaussianProcessRegression &gp, const Observation &observations, const AtomsConfiguration &atoms)
Write gp-state.npz. A second save of the same state is the same bytes.
Definition GpState.cpp:450
std::string outputDirectory(const std::string &output_path)
Directory of an output path, or . when the path has no directory.
Definition GpState.cpp:714
int seedSession(neb::ActiveLearningSession &session, const TrainedGpState &state, bool require_identity, Eigen::Index expected_cols)
Definition GpState.cpp:638
The nudged elastic band: path, GP-NEB driver, configuration and result, acquisition,...
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
Eigen::Matrix< double, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixd
Definition Macros.h:25
Stores configurations of all atoms in the system.
Definition Structures.h:832
Observation data: energy, gradient and positions.
std::string kernel_text
Definition GpState.h:36
Observation observations
Definition GpState.h:22
FieldMatrixd atomistic_length_scale
Definition GpState.h:24
std::string identity
Definition GpState.h:37
FieldMatrixd length_scale
Definition GpState.h:23
bool has_atomistic_length_scale
Definition GpState.h:25