xnn.common.config.schema.OptimConfig#

class xnn.common.config.schema.OptimConfig(lr=0.001, weight_decay=0.0, epochs=100, energy_weight=1.0, force_weight=10.0, stress_weight=0.0, scheduler='plateau', huber_delta=0.0, huber_delta_energy=None, huber_delta_forces=None, huber_delta_stress=None)[source]#

Bases: object

Optimizer, schedule, and loss-weighting settings.

Variables:
  • lr (float) – Learning rate. Defaults to 1e-3.

  • weight_decay (float) – L2 weight-decay coefficient. Defaults to 0.0.

  • epochs (int) – Number of training epochs. MACE max_num_epochs. Defaults to 100.

  • energy_weight (float) – Weight of the energy term in the loss. MACE energy_weight. Defaults to 1.0.

  • force_weight (float) – Weight of the force term in the loss. Defaults to 10.0.

  • stress_weight (float) – Weight of the stress term; values > 0 enable stress training for periodic systems. Defaults to 0.0.

  • scheduler (str) – Learning-rate scheduler (none / cosine / plateau). MACE uses ReduceLROnPlateau. Defaults to "plateau".

  • huber_delta (float) – Crossover from quadratic to linear in the loss, which caps the pull of a few large residuals. 0.0 (the default) is plain squared error. Note xnn scales the Huber function to agree with the squared error below delta, so the loss weights keep their meaning when it is switched on; MACE uses the textbook half-square form.

  • huber_delta_energy (float, optional) – Per-term override of huber_delta for the energy term. None (default) falls back to it. Energies (eV per atom) and forces (eV/A) differ in scale by an order of magnitude, so one delta rarely suits both.

  • huber_delta_forces (float, optional) – Per-term override of huber_delta for the force term.

  • huber_delta_stress (float, optional) – Per-term override of huber_delta for the stress term.

Parameters: