deepmd.dpmodel.loss.ener#

Classes#

EnergyLoss

The unit operation of a native model.

Functions#

custom_huber_loss(→ deepmd.dpmodel.array_api.Array)

Module Contents#

deepmd.dpmodel.loss.ener.custom_huber_loss(predictions: deepmd.dpmodel.array_api.Array, targets: deepmd.dpmodel.array_api.Array, delta: float = 1.0) deepmd.dpmodel.array_api.Array[source]#
class deepmd.dpmodel.loss.ener.EnergyLoss(starter_learning_rate: float, start_pref_e: float = 0.02, limit_pref_e: float = 1.0, start_pref_f: float = 1000, limit_pref_f: float = 1.0, start_pref_v: float = 0.0, limit_pref_v: float = 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_huber: bool = False, huber_delta: float = 0.01, **kwargs: Any)[source]#

Bases: deepmd.dpmodel.loss.loss.Loss

The unit operation of a native model.

starter_learning_rate[source]#
start_pref_e = 0.02[source]#
limit_pref_e = 1.0[source]#
start_pref_f = 1000[source]#
limit_pref_f = 1.0[source]#
start_pref_v = 0.0[source]#
limit_pref_v = 0.0[source]#
start_pref_ae = 0.0[source]#
limit_pref_ae = 0.0[source]#
start_pref_pf = 0.0[source]#
limit_pref_pf = 0.0[source]#
relative_f = None[source]#
enable_atom_ener_coeff = False[source]#
start_pref_gf = 0.0[source]#
limit_pref_gf = 0.0[source]#
numb_generalized_coord = 0[source]#
has_e[source]#
has_f[source]#
has_v[source]#
has_ae[source]#
has_pf[source]#
has_gf[source]#
use_huber = False[source]#
huber_delta = 0.01[source]#
call(learning_rate: float, natoms: int, model_dict: dict[str, deepmd.dpmodel.array_api.Array], label_dict: dict[str, deepmd.dpmodel.array_api.Array]) dict[str, deepmd.dpmodel.array_api.Array][source]#

Calculate loss from model results and labeled results.

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

Return data label requirements needed for this loss calculation.

serialize() dict[source]#

Serialize the loss module.

Returns:
dict

The serialized loss module

classmethod deserialize(data: dict) deepmd.dpmodel.loss.loss.Loss[source]#

Deserialize the loss module.

Parameters:
datadict

The serialized loss module

Returns:
Loss

The deserialized loss module