xnn.common.train.reactions#

Reaction-energy loss: errors of energy differences between structures.

A reaction energy is dE_r = sum_s nu_rs E_s over the species s with signed stoichiometric coefficients nu_rs. ReactionSet holds the species, the coefficients, the reference reaction energies and two per-reaction factors: a scale that multiplies the error (scale = 56.84 / <|dE|> of each set gives the weighting of WTMAD-2) and a weight of the mean. reaction_energy_loss() is the weighted mean of the squared (or Huber) scaled errors. ReactionSet.batches() draws mini-batches of reactions with the species they need, and Trainer adds the term to its loss (optim.reaction_weight).

Functions

reaction_energies(species_energy, stoichiometry)

Reaction energies nu E (R,) from species energies (S,) and coefficients (R, S).

reaction_energy_loss(species_energy, ...[, ...])

The weighted mean of the squared errors of reaction energies.

Classes

ReactionSet(structures, reactions[, units])

Reactions over a list of species structures.