deepmd.tf.loss.tensor#

Classes#

TensorLoss

Loss function for tensorial properties.

Module Contents#

class deepmd.tf.loss.tensor.TensorLoss(jdata, **kwarg)[source]#

Bases: deepmd.tf.loss.loss.Loss

Loss function for tensorial properties.

tensor_name[source]#
tensor_size[source]#
label_name[source]#
local_weight[source]#
global_weight[source]#
build(learning_rate, natoms, model_dict, label_dict, suffix)[source]#

Build the loss function graph.

Parameters:
learning_ratetf.Tensor

learning rate

natomstf.Tensor

number of atoms

model_dictdict[str, tf.Tensor]

A dictionary that maps model keys to tensors

label_dictdict[str, tf.Tensor]

A dictionary that maps label keys to tensors

suffixstr

suffix

Returns:
tf.Tensor

the total squared loss

dict[str, tf.Tensor]

A dictionary that maps loss keys to more loss tensors

eval(sess, feed_dict, natoms)[source]#

Eval the loss function.

Parameters:
sesstf.Session

TensorFlow session

feed_dictdict[tf.placeholder, tf.Tensor]

A dictionary that maps graph elements to values

natomstf.Tensor

number of atoms

Returns:
dict

A dictionary that maps keys to values. It should contain key natoms

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

Return data label requirements needed for this loss calculation.