Loss functions
elfes.modules.losses compares predictions with reference physical quantities. The choice of loss specifies both the error being measured and how it is weighted across components, atoms, or samples. The reference is organized by the structure of the quantity being compared.
Cartesian losses cover scalar, vector, and tensor values at sample or atom level. Orbital-vector losses compare coefficients directly or through a quadratic form. Orbital-matrix losses compare stored atom-pair blocks or Bloch matrices in an orthonormal basis. Real-space losses integrate errors using grid volumes or quadrature weights.
Reduction is part of the mathematical definition of each loss: an average over components, a sample-balanced error, and a spatial integral weight the data differently. Each function documents the exact formula and returned shape, including the meaning of reduction="none". The training engine combines the resulting objectives during training and evaluation.