{ }
View source on GitHub |
Adds a hinge loss to the training procedure.
tf.compat.v1.losses.hinge_loss(
labels,
logits,
weights=1.0,
scope=None,
loss_collection=ops.GraphKeys.LOSSES,
reduction=Reduction.SUM_BY_NONZERO_WEIGHTS
)
Returns | |
---|---|
Weighted loss float Tensor . If reduction is NONE , this has the same
shape as labels ; otherwise, it is scalar.
|
Raises | |
---|---|
ValueError
|
If the shapes of logits and labels don't match or
if labels or logits is None.
|
eager compatibility
The loss_collection
argument is ignored when executing eagerly. Consider
holding on to the return value or collecting losses via a tf.keras.Model
.