Home | History | Annotate | Download | only in losses

Lines Matching refs:losses

36 @tf_export("losses.add_loss")
37 def add_loss(loss, loss_collection=ops.GraphKeys.LOSSES):
38 """Adds a externally defined loss to the collection of losses.
48 @tf_export("losses.get_losses")
49 def get_losses(scope=None, loss_collection=ops.GraphKeys.LOSSES):
50 """Gets the list of losses from the loss_collection.
53 scope: An optional scope name for filtering the losses to return.
54 loss_collection: Optional losses collection.
62 @tf_export("losses.get_regularization_losses")
64 """Gets the list of regularization losses.
67 scope: An optional scope name for filtering the losses to return.
70 A list of regularization losses as Tensors.
75 @tf_export("losses.get_regularization_loss")
80 scope: An optional scope name for filtering the losses to return.
86 losses = get_regularization_losses(scope)
87 if losses:
88 return math_ops.add_n(losses, name=name)
93 @tf_export("losses.get_total_loss")
97 In particular, this adds any losses you have added with `tf.add_loss()` to
98 any regularization losses that have been added by regularization parameters
105 regularization losses in the sum.
112 ValueError: if `losses` is not iterable.
114 losses = get_losses()
116 losses += get_regularization_losses()
117 return math_ops.add_n(losses, name=name)