Predicting with Gaussian process regression models
ichor does not make Gaussian process model files, however it can be used to predict with previously created model files. The model files are produced by either GPyTorch or the in-house FEREBUS code. The .model file extension is used for model files and can be read in by the Model class. Alternatively, a set of .model files can be read in with the Models class.
Currently the RBF and Periodic kernels are used for the GPR models. These are also implemented in ichor and the correct kernels are read to use are read in from the model file.
Making predictions with ichor
[1]:
from ichor.core.models import Models
from ichor.core.files import Trajectory
from ichor.core.calculators import calculate_alf_features
models = Models("../../../example_files/models")
traj = Trajectory("../../../example_files/xyz/AMMONIA-1000.xyz")
atoms = traj[0]
# loop over models
for m in models:
# get atom for which the model is made
atom = atoms[m.atom_name]
atom_alf = m.alf
atom_features = atom.features(calculate_alf_features, atom_alf)
pred = m.predict(atom_features)
print(atom.name, pred)
N1 [-54.97401087]
H2 [-0.53780037]
H3 [-0.56134275]
H4 [-0.5568125]