Home | History | Annotate | Download | only in losses

Lines Matching refs:math_ops

27 from tensorflow.python.ops import math_ops
62 reduced_losses = math_ops.reduce_sum(
64 reduced_losses = math_ops.multiply(reduced_losses, weights)
65 return math_ops.reduce_sum(reduced_losses)
85 math_ops.greater(denominator, 0),
86 math_ops.div(numerator,
88 math_ops.equal(denominator, 0),
105 total_loss = math_ops.reduce_sum(losses)
129 losses = math_ops.to_float(losses)
130 weights = math_ops.to_float(ops.convert_to_tensor(weights))
145 mean_loss = math_ops.cast(mean_loss, input_dtype)
175 num_per_batch = math_ops.div(
176 math_ops.to_float(array_ops.size(losses)),
177 math_ops.to_float(batch_size))
179 math_ops.equal(weights, 0), 0.0, num_per_batch)
180 num_per_batch = math_ops.multiply(
182 return num_per_batch if per_batch else math_ops.reduce_sum(num_per_batch)
187 num_nonzero_per_batch = math_ops.reduce_sum(
188 math_ops.to_float(math_ops.not_equal(weights, 0)),
194 num_to_broadcast = math_ops.to_float(math_ops.reduce_prod(broadcast_dims))
196 num_per_batch = math_ops.multiply(num_nonzero_per_batch, num_to_broadcast)
197 return num_per_batch if per_batch else math_ops.reduce_sum(num_per_batch)
260 return math_ops.add_n(losses, name=name)
292 predictions = math_ops.to_float(predictions)
293 labels = math_ops.to_float(labels)
294 losses = math_ops.abs(math_ops.subtract(predictions, labels))
338 multi_class_labels = math_ops.cast(multi_class_labels, logits.dtype)
387 onehot_labels = math_ops.cast(onehot_labels, logits.dtype)
390 num_classes = math_ops.cast(
468 predictions = math_ops.to_float(predictions)
469 labels = math_ops.to_float(labels)
470 losses = -math_ops.multiply(
471 labels, math_ops.log(predictions + epsilon)) - math_ops.multiply(
472 (1 - labels), math_ops.log(1 - predictions + epsilon))
500 labels = math_ops.to_float(labels)
502 labels = math_ops.subtract(2 * labels, all_ones)
504 math_ops.subtract(all_ones, math_ops.multiply(labels, logits)))
536 predictions = math_ops.to_float(predictions)
537 labels = math_ops.to_float(labels)
538 losses = math_ops.square(math_ops.subtract(predictions, labels))
590 predictions = math_ops.to_float(predictions)
591 labels = math_ops.to_float(labels)
592 weights = math_ops.to_float(ops.convert_to_tensor(weights))
594 diffs = math_ops.subtract(predictions, labels)
604 sum_squares_diff_per_batch = math_ops.reduce_sum(
605 math_ops.square(diffs), reduction_indices=reduction_indices)
610 sum_diff = math_ops.reduce_sum(diffs, reduction_indices=reduction_indices)
612 math_ops.square(sum_diff), math_ops.square(num_present_per_batch))
617 math_ops.reduce_sum(num_present_per_batch) > 0,
664 predictions = math_ops.to_float(predictions)
665 labels = math_ops.to_float(labels)
667 radial_diffs = math_ops.multiply(predictions, labels)
668 losses = 1 - math_ops.reduce_sum(