deepmd.pt.loss.loss#
Classes#
Helper class that provides a standard way to create an ABC using |
Module Contents#
- class deepmd.pt.loss.loss.TaskLoss(**kwargs)[source]#
Bases:
torch.nn.Module,abc.ABC,make_plugin_registry('loss')Helper class that provides a standard way to create an ABC using inheritance.
- abstractmethod forward(input_dict, model, label, natoms, learning_rate) NoReturn[source]#
Return loss .
- property label_requirement: list[deepmd.utils.data.DataRequirementItem][source]#
- Abstractmethod:
Return data label requirements needed for this loss calculation.
- static display_if_exist(loss: torch.Tensor, find_property: float) torch.Tensor[source]#
Display NaN if labeled property is not found.
- Parameters:
- loss
torch.Tensor the loss tensor
- find_property
float whether the property is found
- loss
- classmethod get_loss(loss_params: dict) TaskLoss[source]#
Get the loss module by the parameters.
By default, all the parameters are directly passed to the constructor. If not, override this method.