/external/tensorflow/tensorflow/python/keras/ |
D | losses.py | 123 def __call__(self, y_true, y_pred, sample_weight=None): argument 152 y_true, y_pred, sample_weight) 158 losses = call_fn(y_true, y_pred) 180 def call(self, y_true, y_pred): argument 248 def call(self, y_true, y_pred): argument 258 if tensor_util.is_tf_type(y_pred) and tensor_util.is_tf_type(y_true): 259 y_pred, y_true = losses_utils.squeeze_or_expand_dimensions(y_pred, y_true) 262 return ag_fn(y_true, y_pred, **self._fn_kwargs) 1195 def mean_squared_error(y_true, y_pred): argument 1219 y_pred = ops.convert_to_tensor_v2_with_dispatch(y_pred) [all …]
|
D | metrics_functional_test.py | 44 y_pred = K.variable(np.random.random((6, 7))) 45 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) 49 y_pred = K.variable([[0.8, 0.2], [0.6, 0.4], [0.7, 0.3], [0.9, 0.1]]) 50 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.]) 54 y_pred = K.variable([[0.8, 0.2], [0.6, 0.4], [0.7, 0.3], [0.9, 0.1]]) 55 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.]) 59 y_pred = K.variable( 63 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [[1., 0.], [0., 1.]]) 69 y_pred = K.variable(np.random.random((6, 7))) 70 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) [all …]
|
D | losses_test.py | 184 y_pred = backend.variable(np.array([[0.3, 0.2, 0.1], [0.1, 0.2, 0.7]])) 187 loss = backend.eval(losses.categorical_hinge(y_true, y_pred)) 198 y_pred = constant_op.constant([[4., 8.], [12., 3.]]) 200 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight) 212 def loss_fn(y_true, y_pred): argument 215 return mse_loss_fn(y_true, y_pred) 217 return mse_loss_fn(y_true, y_pred) 222 y_pred = constant_op.constant([[4., 8.], [12., 3.]]) 226 def tf_functioned_loss_fn(y_true, y_pred, sample_weight=None): argument 227 return mse_obj(y_true, y_pred, sample_weight=sample_weight) [all …]
|
D | metrics_confusion_matrix_test.py | 61 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 64 update_op = fp_obj.update_state(y_true, y_pred) 74 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 77 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 84 y_pred = constant_op.constant(((0.9, 0.2, 0.8, 0.1), (0.2, 0.9, 0.7, 0.6), 89 update_op = fp_obj.update_state(y_true, y_pred) 98 y_pred = constant_op.constant(((0.9, 0.2, 0.8, 0.1), (0.2, 0.9, 0.7, 0.6), 105 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 141 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 144 update_op = fn_obj.update_state(y_true, y_pred) [all …]
|
D | metrics.py | 560 def update_state(self, y_true, y_pred, sample_weight=None): argument 574 y_pred = math_ops.cast(y_pred, self._dtype) 575 [y_pred, y_true], sample_weight = \ 577 [y_pred, y_true], sample_weight) 578 y_pred, y_true = losses_utils.squeeze_or_expand_dimensions( 579 y_pred, y_true) 581 y_pred, self.normalizer = losses_utils.remove_squeezable_dimensions( 582 y_pred, self.normalizer) 583 y_pred.shape.assert_is_compatible_with(y_true.shape) 585 math_ops.abs(y_true - y_pred), self.normalizer) [all …]
|
D | metrics_test.py | 622 y_pred = self.l2_norm(self.np_y_pred, axis) 623 self.expected_loss = np.sum(np.multiply(y_true, y_pred), axis=(axis,)) 626 self.y_pred = constant_op.constant(self.np_y_pred) 643 loss = cosine_obj(self.y_true, self.y_pred) 654 self.y_pred, 664 loss = cosine_obj(self.y_true, self.y_pred) 687 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 690 update_op = mae_obj.update_state(y_true, y_pred) 700 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 703 result = mae_obj(y_true, y_pred, sample_weight=sample_weight) [all …]
|
/external/tensorflow/tensorflow/tools/api/golden/v2/ |
D | tensorflow.keras.losses.pbtxt | 73 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 77 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 81 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 85 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 89 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 93 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 97 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 101 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 105 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… 117 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
D | tensorflow.losses.pbtxt | 73 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 77 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 81 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 85 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 89 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 93 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 97 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 101 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 105 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… 117 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
D | tensorflow.metrics.pbtxt | 157 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 161 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 165 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 169 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 173 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 177 …argspec: "args=[\'y_true\', \'y_pred\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 185 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 189 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 201 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
D | tensorflow.keras.metrics.pbtxt | 157 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 161 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 165 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 169 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 173 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 177 …argspec: "args=[\'y_true\', \'y_pred\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 185 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 189 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 201 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
/external/tensorflow/tensorflow/tools/api/golden/v1/ |
D | tensorflow.keras.losses.pbtxt | 69 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 73 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 77 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 81 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 85 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 89 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 93 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 97 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 101 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… 105 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… [all …]
|
D | tensorflow.keras.metrics.pbtxt | 157 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 161 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 165 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 169 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 173 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 177 …argspec: "args=[\'y_true\', \'y_pred\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 185 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 189 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 193 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… [all …]
|
/external/tensorflow/tensorflow/python/keras/engine/ |
D | compile_utils.py | 41 def build(self, y_pred): argument 45 self._output_names = create_pseudo_output_names(y_pred) 135 def build(self, y_pred): argument 137 super(LossesContainer, self).build(y_pred) 139 self._losses = self._maybe_broadcast_to_outputs(y_pred, self._losses) 140 self._losses = self._conform_to_outputs(y_pred, self._losses) 145 y_pred, self._loss_weights) 146 self._loss_weights = self._conform_to_outputs(y_pred, self._loss_weights) 167 y_pred, argument 184 y_true = self._conform_to_outputs(y_pred, y_true) [all …]
|
D | training_gpu_test.py | 49 … loss = lambda y_true, y_pred: K.sparse_categorical_crossentropy( # pylint: disable=g-long-lambda argument 50 y_true, y_pred, axis=axis) 54 loss = lambda y_true, y_pred: K.categorical_crossentropy( # pylint: disable=g-long-lambda argument 55 y_true, y_pred, axis=axis) 59 …loss = lambda y_true, y_pred: K.binary_crossentropy(y_true, y_pred) # pylint: disable=unnecessary… argument
|
D | compile_utils_test.py | 345 def custom_loss_fn(y_true, y_pred): argument 346 return math_ops.reduce_sum(y_true - y_pred) 350 def __call__(self, y_true, y_pred): argument 351 return math_ops.reduce_sum(y_true - y_pred) 364 def custom_loss_fn(y_true, y_pred): argument 366 return losses_mod.mse(y_true, y_pred) 371 def call(self, y_true, y_pred): argument 373 math_ops.squared_difference, y_true, y_pred) 751 def custom_metric_fn(y_true, y_pred): argument 752 return math_ops.reduce_sum(y_true - y_pred) [all …]
|
/external/tensorflow/tensorflow/python/ops/losses/ |
D | util.py | 34 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument 58 y_pred_shape = y_pred.shape 71 y_true, y_pred = confusion_matrix.remove_squeezable_dimensions( 72 y_true, y_pred) 75 rank_diff = array_ops.rank(y_pred) - array_ops.rank(y_true) 77 y_true, y_pred) 78 is_last_dim_1 = math_ops.equal(1, array_ops.shape(y_pred)[-1]) 80 is_last_dim_1, squeeze_dims, lambda: (y_true, y_pred)) 81 y_true, y_pred = control_flow_ops.cond( 85 return y_pred, y_true [all …]
|
/external/tensorflow/tensorflow/python/keras/utils/ |
D | metrics_utils.py | 238 y_pred, argument 312 y_pred = math_ops.cast(y_pred, dtype=variable_dtype) 322 [y_pred, 323 y_true], _ = ragged_assert_compatible_and_get_flat_values([y_pred, y_true], 337 y_pred, 338 math_ops.cast(0.0, dtype=y_pred.dtype), 341 y_pred, 342 math_ops.cast(1.0, dtype=y_pred.dtype), 346 y_pred, y_true = losses_utils.squeeze_or_expand_dimensions( 347 y_pred, y_true) [all …]
|
D | losses_utils.py | 146 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument 170 y_pred_shape = y_pred.shape 183 y_true, y_pred = remove_squeezable_dimensions( 184 y_true, y_pred) 187 rank_diff = array_ops.rank(y_pred) - array_ops.rank(y_true) 189 y_true, y_pred) 190 is_last_dim_1 = math_ops.equal(1, array_ops.shape(y_pred)[-1]) 192 is_last_dim_1, squeeze_dims, lambda: (y_true, y_pred)) 193 y_true, y_pred = control_flow_ops.cond( 197 return y_pred, y_true [all …]
|
/external/tensorflow/tensorflow/lite/micro/examples/hello_world/ |
D | hello_world_test.cc | 102 float y_pred = (y_pred_quantized - output_zero_point) * output_scale; in TF_LITE_MICRO_TEST() local 106 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST() 113 y_pred = (output->data.int8[0] - output_zero_point) * output_scale; in TF_LITE_MICRO_TEST() 114 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST() 120 y_pred = (output->data.int8[0] - output_zero_point) * output_scale; in TF_LITE_MICRO_TEST() 121 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST() 127 y_pred = (output->data.int8[0] - output_zero_point) * output_scale; in TF_LITE_MICRO_TEST() 128 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST()
|
/external/rnnoise/training/ |
D | rnn_train.py | 31 def my_crossentropy(y_true, y_pred): argument 32 return K.mean(2*K.abs(y_true-0.5) * K.binary_crossentropy(y_pred, y_true), axis=-1) 37 def msse(y_true, y_pred): argument 38 return K.mean(mymask(y_true) * K.square(K.sqrt(y_pred) - K.sqrt(y_true)), axis=-1) 40 def mycost(y_true, y_pred): argument 41 …square(K.square(K.sqrt(y_pred) - K.sqrt(y_true))) + K.square(K.sqrt(y_pred) - K.sqrt(y_true)) + 0.… 43 def my_accuracy(y_true, y_pred): argument 44 return K.mean(2*K.abs(y_true-0.5) * K.equal(y_true, K.round(y_pred)), axis=-1)
|
/external/libopus/training/ |
D | rnn_train.py | 28 def binary_crossentrop2(y_true, y_pred): argument 29 return K.mean(2*K.abs(y_true-0.5) * K.binary_crossentropy(y_true, y_pred), axis=-1) 31 def binary_accuracy2(y_true, y_pred): argument 32 …return K.mean(K.cast(K.equal(y_true, K.round(y_pred)), 'float32') + K.cast(K.equal(y_true, 0.5), '…
|
D | rnn_dump.py | 35 def binary_crossentrop2(y_true, y_pred): argument 36 return K.mean(2*K.abs(y_true-0.5) * K.binary_crossentropy(y_pred, y_true), axis=-1)
|
/external/libopus/scripts/ |
D | dump_rnn.py | 32 def binary_crossentrop2(y_true, y_pred): argument 33 return K.mean(2*K.abs(y_true-0.5) * K.binary_crossentropy(y_pred, y_true), axis=-1)
|
D | rnn_train.py | 19 def binary_crossentrop2(y_true, y_pred): argument 20 return K.mean(2*K.abs(y_true-0.5) * K.binary_crossentropy(y_pred, y_true), axis=-1)
|
/external/tensorflow/tensorflow/python/keras/tests/ |
D | custom_training_loop_test.py | 102 y_pred = model(x, training=True) 103 loss = keras.losses.binary_crossentropy(y, y_pred) 127 y_pred = y_pred_1 + y_pred_2 128 loss = keras.losses.mean_squared_error(y, y_pred)
|