deepmd.pt.loss.property#

Attributes#

Classes#

PropertyLoss

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

Module Contents#

deepmd.pt.loss.property.log[source]#
class deepmd.pt.loss.property.PropertyLoss(task_dim, var_name: str, loss_func: str = 'smooth_mae', metric: list = ['mae'], beta: float = 1.0, out_bias: list | None = None, out_std: list | None = None, intensive: bool = False, **kwargs)[source]#

Bases: deepmd.pt.loss.loss.TaskLoss

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

task_dim[source]#
loss_func = 'smooth_mae'[source]#
metric = ['mae'][source]#
beta = 1.0[source]#
out_bias = None[source]#
out_std = None[source]#
intensive = False[source]#
var_name[source]#
forward(input_dict, model, label, natoms, learning_rate=0.0, mae=False)[source]#

Return loss on properties .

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.