deepmd.pt.loss.ener#

Classes#

EnergyStdLoss

Helper class that provides a standard way to create an ABC using

Module Contents#

class deepmd.pt.loss.ener.EnergyStdLoss(starter_learning_rate=1.0, start_pref_e=0.0, limit_pref_e=0.0, start_pref_f=0.0, limit_pref_f=0.0, start_pref_v=0.0, limit_pref_v=0.0, start_pref_ae: float = 0.0, limit_pref_ae: float = 0.0, start_pref_pf: float = 0.0, limit_pref_pf: float = 0.0, relative_f: float | None = None, enable_atom_ener_coeff: bool = False, start_pref_gf: float = 0.0, limit_pref_gf: float = 0.0, numb_generalized_coord: int = 0, use_l1_all: bool = False, inference=False, **kwargs)[source]#

Bases: deepmd.pt.loss.loss.TaskLoss

Helper class that provides a standard way to create an ABC using inheritance.

starter_learning_rate[source]#
has_e[source]#
has_f[source]#
has_v[source]#
has_ae[source]#
has_pf[source]#
has_gf[source]#
start_pref_e[source]#
limit_pref_e[source]#
start_pref_f[source]#
limit_pref_f[source]#
start_pref_v[source]#
limit_pref_v[source]#
start_pref_ae[source]#
limit_pref_ae[source]#
start_pref_pf[source]#
limit_pref_pf[source]#
start_pref_gf[source]#
limit_pref_gf[source]#
relative_f[source]#
enable_atom_ener_coeff[source]#
numb_generalized_coord[source]#
use_l1_all[source]#
inference[source]#
forward(input_dict, model, label, natoms, learning_rate, mae=False)[source]#

Return loss on energy and force.

Parameters:
input_dictdict[str, torch.Tensor]

Model inputs.

modeltorch.nn.Module

Model to be used to output the predictions.

labeldict[str, torch.Tensor]

Labels.

natomsint

The local atom number.

Returns:
model_pred: dict[str, torch.Tensor]

Model predictions.

loss: torch.Tensor

Loss for model to minimize.

more_loss: dict[str, torch.Tensor]

Other losses for display.

property label_requirement: list[deepmd.utils.data.DataRequirementItem][source]#

Return data label requirements needed for this loss calculation.