deepmd.tf.loss.tensor

Module Contents

Classes

TensorLoss

Loss function for tensorial properties.

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

Bases: deepmd.tf.loss.loss.Loss

Loss function for tensorial properties.

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