deepmd.utils.weight_avg#
Functions#
| Combine prediction errors, keeping the weight they were combined over. |
| Compute weighted average of prediction errors (MAE or RMSE) for model. |
Module Contents#
- deepmd.utils.weight_avg.merge_weighted_errors(errors: list[dict[str, tuple[float, float]]]) dict[str, tuple[float, float]][source]#
Combine prediction errors, keeping the weight they were combined over.
An MAE is the mean of the absolute errors and an RMSE the root of the mean of their squares, so both are recovered exactly from the partial results by weighting the mean, respectively the squared mean, by the number of elements each was taken over. Combining partial results is therefore equivalent to evaluating the whole set at once, which lets a caller evaluate in chunks.
- Parameters:
- Returns:
- Raises:
RuntimeErrorIf a quantity name identifies neither an MAE nor an RMSE.