Adds a cosine-distance loss to the training procedure. (deprecated arguments)
tf.compat.v1.losses.cosine_distance( labels, predictions, axis=None, weights=1.0, scope=None, loss_collection=tf.GraphKeys.LOSSES, reduction=Reduction.SUM_BY_NONZERO_WEIGHTS, dim=None )
Note that the function assumes that
labels are already unit-normalized.
| || |
| ||An arbitrary matrix.|
| ||The dimension along which the cosine distance is computed.|
| || Optional |
| ||The scope for the operations performed in computing the loss.|
| ||collection to which this loss will be added.|
| ||Type of reduction to apply to loss.|
| || The old (deprecated) name for |
| Weighted loss float |
| || If |
loss_collection argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.