loss_f_e_weighted_mse#

mbgdml.losses.loss_f_e_weighted_mse(results, rho, n_atoms)[source]#

Computes a combined energy and force loss function.

\[l = \frac{\rho}{Q} \left\Vert E - \hat{E} \right\Vert^2 + \frac{1}{n_{atoms} Q} \sum_{i=0}^{n_{atoms}} \left\Vert \bf{F}_i - \widehat{\bf{F}}_i \right\Vert^2,\]

where \(\rho\) is a trade-off between energy and force errors, \(Q\) is the number of validation structures, \(\Vert \ldots \Vert\) is the norm, and \(\widehat{\;}\) is the model prediction of the property.

Parameters:
  • results (dict) – Results which contains at least force and energy errors under the 'force' and 'energy' keys, respectively.

  • rho (float) – Energy and force trade-off, \(\rho\). A recommended value would be in the range of 0.01 to 0.1. Larger values place more importance on energy accuracy.

  • n_atoms (int) – Number of atoms.

Returns:

Loss.

Return type:

float