- class kliff.analyzers.rmse.EnergyForcesRMSE(calculator, energy=True, forces=True)[source]¶
Analyzer to compute the root-mean-square error (RMSE) for energy and forces.
The energy difference norm for a configuration is defined as:
where
is the prediction of the total energy from the model,
is the corresponding reference energy, and
is the number of atoms in the configuration. The division by
is applied only when
normalize = Trueinrun. Similarly, the forces difference norm for a configuration is defined as:where
is the prediction of the forces on atoms from the model and
is the corresponding reference forces,
is the number of atoms in the configuration. The division by
is applied only when
normalize = Trueinrun.The RMSEs for energy and forces are defined as:
and
in which
is the total number of configurations in the dataset.
- run(normalize=True, sort=None, path=None, verbose=1)[source]¶
Run the RMSE analyzer.
- Parameters:
normalize (bool) – Whether to normalize the energy (forces) by the number of atoms in a configuration.
sort (str (optional)) – Sort per configuration information according to energy or forces. If None, no sort. This works only when per configuration information is requested, i.e.
verbose > 0.path (str (optional)) – Path to write out the results. If None, write to stdout, otherwise, write to the file specified by path. Note, if
verbose==3, the difference of energy and forces will be written to a directory named energy_forces_RMSE-difference.verbose (int (optional)) – Verbose level of the output info. Available values are: 0, 1, 2. If
verbose=0, only output the energy and forces RMSEs for the dataset. Ifverbose==1, output the norms of the energy and forces for each configuration additionally. Ifverbose==2, output the difference of the energy and forces for each atom, and the information is written to extended XYZ files with the location specified bypath.