Scine::Swoose
2.1.0
This is the SCINE module Swoose.
|
The combination of the machine learning models for molecular energies and atomic forces. More...
#include <MolecularMachineLearningModel.h>
Public Member Functions | |
MolecularMachineLearningModel ()=default | |
Default constructor. | |
void | setReferenceData (const Utils::MolecularTrajectory &structures, const std::vector< ForcesCollection > &refForces) |
Sets the reference data. More... | |
void | trainEnergyModel () |
Trains the energy model. | |
void | trainForcesModel () |
Trains the forces model. | |
double | predictEnergy (const Utils::AtomCollection &structure) |
Predicts the energy for a given structure. | |
ForcesCollection | predictForces (const Utils::AtomCollection &structure) |
Predicts the forces for a given structure. | |
std::pair< double, double > | evaluateEnergyModel (int k) |
Validates the energy model via k-fold cross validation. More... | |
std::pair< double, double > | evaluateForcesModel (int k, bool pooledVariance=true) |
Validates the model for the atomic forces via k-fold cross validation. More... | |
Utils::MachineLearning::KernelRidgeRegression & | energyPredictor () |
Accessor for the underlying energy model. | |
Utils::MachineLearning::KernelRidgeRegression & | forcePredictor (int atomIndex) |
Accessor for the underlying force model of the atom with index 'atomIndex'. | |
The combination of the machine learning models for molecular energies and atomic forces.
std::pair< double, double > Scine::Swoose::MachineLearning::MolecularMachineLearningModel::evaluateEnergyModel | ( | int | k | ) |
Validates the energy model via k-fold cross validation.
k | The number of subsets k for the k-fold cross validation algorithm. |
std::pair< double, double > Scine::Swoose::MachineLearning::MolecularMachineLearningModel::evaluateForcesModel | ( | int | k, |
bool | pooledVariance = true |
||
) |
Validates the model for the atomic forces via k-fold cross validation.
k | The number of subsets k for the k-fold cross validation algorithm. |
pooledVariance | Decides whether the standard deviation estimate for the forces is based on the principle of pooled variance. The alternative is a true combined variance that considers the different MAE means of the atomic forces. |
void Scine::Swoose::MachineLearning::MolecularMachineLearningModel::setReferenceData | ( | const Utils::MolecularTrajectory & | structures, |
const std::vector< ForcesCollection > & | refForces | ||
) |
Sets the reference data.
structures | The molecular trajectory containing the structures along with their reference energies. |
refForces | A vector of the reference forces for each structure. |