tf.contrib.losses.mean_pairwise_squared_error( predictions, labels=None, weights=1.0, scope=None )
Adds a pairwise-errors-squared loss to the training procedure. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-12-30. Instructions for updating: Use tf.losses.mean_pairwise_squared_error instead. Note that the order of the predictions and labels arguments has been changed.
mean_squared_error, which is a measure of the differences between corresponding elements of
mean_pairwise_squared_error is a measure of the differences between pairs of corresponding elements of
For example, if
labels=[a, b, c] and
predictions=[x, y, z], there are three pairs of differences are summed to compute the loss: loss = [ ((a-b) - (x-y)).^2 + ((a-c) - (x-z)).^2 + ((b-c) - (y-z)).^2 ] / 3
Note that since the inputs are of size [batch_size, d0, ... dN], the corresponding pairs are computed within each batch sample but not across samples within a batch. For example, if
predictions represents a batch of 16 grayscale images of dimension [batch_size, 100, 200], then the set of pairs is drawn from each image, but not across images.
weights acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If
weights is a tensor of size [batch_size], then the total loss for each sample of the batch is rescaled by the corresponding element in the
predictions: The predicted outputs, a tensor of size [batch_size, d0, .. dN] where N+1 is the total number of dimensions in
labels: The ground truth output tensor, whose shape must match the shape of the
weights: Coefficients for the loss a scalar, a tensor of shape [batch_size] or a tensor whose shape matches
scope: The scope for the operations performed in computing the loss.
Tensor representing the loss value.
ValueError: If the shape of
predictionsdoesn't match that of
labelsor if the shape of
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.