training_metrics
MAE of energy, MAE for gradient, MAE for proj_minao.
- class MAEEnergy(mode='per molecule', sample_weigher: SampleWeigher | None = 'default')[source]
Metric for the mean absolute error of the kinetic energy. When
mode="per molecule", the error is averaged as.\[\text{MAE_Energy} = \frac{1}{\text{n_molecules}}\sum_d\sum_k | T_{S,\Theta}(\textbf{p}^{(d,k)},\mathcal{M^{(d)}})-T_S^{(d,k)}|.\]
- class MAEGradient(mode='per molecule', sample_weigher: SampleWeigher | None = 'default')[source]
Mean Absolute Error - Metric of the gradient of the kinetic energy averaged over the number of molecules.
For the default
mode="per molecule", the error is averaged as\[\text{MAE_Gradint} = \frac{1}{\text{n_molecules}}\sum_d\sum_k || \left( \textbf{I}-\frac{\textbf{w}^{(d)}{\textbf{w}^{(d)}}^T}{{\textbf{w}^{(d)}}^T \textbf{w}^{(d)}}\right)\left(\nabla_\textbf{p} T_{S,\Theta}(\textbf{p}^{(d,k)},\mathcal{M^{(d)}})- \nabla_\textbf{p} T_S^{(d,k)}\right)||.\]For
mode="per electron", the error is averaged as\[\text{WMAE_Gradint} = \frac{1}{\text{n_molecules}}\sum_d \frac{1}{\text{n_electrons}^{(d)}}\sum_k || \left( \textbf{I}-\frac{\textbf{w}^{(d)}{\textbf{w}^{(d)}}^T}{{\textbf{w}^{(d)}}^T \textbf{w}^{(d)}}\right)\left(\nabla_\textbf{p} T_{S,\Theta}(\textbf{p}^{(d,k)},\mathcal{M^{(d)}}) -\nabla_\textbf{p} T_S^{(d,k)}\right)||.\]
- class MAEInitialGuess(mode='per molecule', sample_weigher: SampleWeigher | None = 'default')[source]
MAE of the initial guess delta coefficients.
- class PerSampleAbsoluteErrorMetric(mode='per molecule', sample_weigher: SampleWeigher | None = 'default')[source]
Base class for metrics that calculate the absolute error per sample.
- __init__(mode='per molecule', sample_weigher: SampleWeigher | None = 'default')[source]
- Parameters:
mode – The averaging mode, either “per molecule” or “per electron”.
sample_weigher (
SampleWeigher, optional) – Sample weigher to be used. Defaults toDEFAULT_SAMPLE_WEIGHER.
- update_with_errors(batch: Batch, errors: Tensor)[source]
Updates the hidden states for a batch and corresponding errors.
- Parameters:
batch – The OFData object, used for updating the molecule and electron count.
errors – The errors that should be accumulated. The shape should either be (batch_size,) or (n_basis,), in the latter case the errors per basis function are summed up to get the error per molecule.