Home
last modified time | relevance | path

Searched refs:y_true (Results 1 – 25 of 191) sorted by relevance

12345678

/external/tensorflow/tensorflow/python/keras/
Dlosses.py123 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
1220 y_true = math_ops.cast(y_true, y_pred.dtype)
[all …]
Dlosses_test.py185 y_true = backend.variable(np.array([[0, 1, 0], [1, 0, 0]]))
187 loss = backend.eval(losses.categorical_hinge(y_true, y_pred))
197 y_true = constant_op.constant([[1., 9.], [2., 5.]])
200 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight)
212 def loss_fn(y_true, y_pred): argument
214 if math_ops.reduce_mean(y_true) > 0:
215 return mse_loss_fn(y_true, y_pred)
217 return mse_loss_fn(y_true, y_pred)
221 y_true = constant_op.constant([[1., 9.], [2., 5.]])
226 def tf_functioned_loss_fn(y_true, y_pred, sample_weight=None): argument
[all …]
Dmetrics_functional_test.py43 y_true = K.variable(np.random.randint(0, 7, (6,)))
45 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,))
48 y_true = K.variable([1., 0., 0., 0.])
50 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.])
53 y_true = K.variable([[1.], [0.], [0.], [0.]])
55 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.])
62 y_true = K.variable(np.array([[1, 0], [1, 0]]))
63 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [[1., 0.], [0., 1.]])
68 y_true = K.variable(np.random.random((6,)))
70 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,))
[all …]
Dmetrics_confusion_matrix_test.py59 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1),
64 update_op = fp_obj.update_state(y_true, y_pred)
72 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1),
77 result = fp_obj(y_true, y_pred, sample_weight=sample_weight)
86 y_true = constant_op.constant(((0, 1, 1, 0), (1, 0, 0, 0), (0, 0, 0, 0),
89 update_op = fp_obj.update_state(y_true, y_pred)
100 y_true = constant_op.constant(((0, 1, 1, 0), (1, 0, 0, 0), (0, 0, 0, 0),
105 result = fp_obj(y_true, y_pred, sample_weight=sample_weight)
139 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1),
144 update_op = fn_obj.update_state(y_true, y_pred)
[all …]
Dmetrics_test.py621 y_true = self.l2_norm(self.np_y_true, axis)
623 self.expected_loss = np.sum(np.multiply(y_true, y_pred), axis=(axis,))
625 self.y_true = constant_op.constant(self.np_y_true)
643 loss = cosine_obj(self.y_true, self.y_pred)
653 self.y_true,
664 loss = cosine_obj(self.y_true, self.y_pred)
685 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1),
690 update_op = mae_obj.update_state(y_true, y_pred)
698 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1),
703 result = mae_obj(y_true, y_pred, sample_weight=sample_weight)
[all …]
Dmetrics.py560 def update_state(self, y_true, y_pred, sample_weight=None): argument
573 y_true = math_ops.cast(y_true, 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)
583 y_pred.shape.assert_is_compatible_with(y_true.shape)
585 math_ops.abs(y_true - y_pred), self.normalizer)
613 def update_state(self, y_true, y_pred, sample_weight=None): argument
634 y_true = math_ops.cast(y_true, self._dtype)
[all …]
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.losses.pbtxt73 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 …]
Dtensorflow.keras.losses.pbtxt73 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 …]
Dtensorflow.keras.metrics.pbtxt157 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 …]
Dtensorflow.metrics.pbtxt157 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/
Dtensorflow.keras.losses.pbtxt69 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 …]
Dtensorflow.keras.metrics.pbtxt157 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/rnnoise/training/
Drnn_train.py31 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)
34 def mymask(y_true): argument
35 return K.minimum(y_true+1., 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
41y_true) * (10*K.square(K.square(K.sqrt(y_pred) - K.sqrt(y_true))) + K.square(K.sqrt(y_pred) - K.sq…
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/tensorflow/tensorflow/python/ops/losses/
Dutil.py34 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument
60 if y_true is not None:
66 y_true_shape = y_true.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)
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/lite/micro/examples/hello_world/
Dhello_world_test.cc30 float y_true = sin(x); in TF_LITE_MICRO_TEST() local
106 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST()
110 y_true = sin(x); in TF_LITE_MICRO_TEST()
114 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST()
117 y_true = sin(x); in TF_LITE_MICRO_TEST()
121 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST()
124 y_true = sin(x); in TF_LITE_MICRO_TEST()
128 TF_LITE_MICRO_EXPECT_NEAR(y_true, y_pred, epsilon); in TF_LITE_MICRO_TEST()
/external/tensorflow/tensorflow/python/keras/utils/
Dlosses_utils.py146 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument
172 if y_true is not None:
178 y_true_shape = y_true.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)
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 …]
Dmetrics_utils.py237 y_true, argument
311 y_true = math_ops.cast(y_true, dtype=variable_dtype)
323 y_true], _ = ragged_assert_compatible_and_get_flat_values([y_pred, y_true],
346 y_pred, y_true = losses_utils.squeeze_or_expand_dimensions(
347 y_pred, y_true)
350 y_pred, y_true, sample_weight = (
352 y_pred, y_true, sample_weight=sample_weight))
353 y_pred.shape.assert_is_compatible_with(y_true.shape)
358 y_true = y_true[..., class_id]
375 math_ops.cast(y_true, dtype=dtypes.bool), 0)
[all …]
/external/tensorflow/tensorflow/python/keras/engine/
Dcompile_utils.py166 y_true, argument
184 y_true = self._conform_to_outputs(y_pred, y_true)
191 y_true = nest.flatten(y_true)
197 zip_args = (y_true, y_pred, sample_weight, self._losses, self._loss_weights,
319 def build(self, y_pred, y_true): argument
333 y_true = nest.list_to_tuple(y_true)
340 self._metrics, y_true, y_pred)
344 y_true, y_pred)
403 def update_state(self, y_true, y_pred, sample_weight=None): argument
405 y_true = self._conform_to_outputs(y_pred, y_true)
[all …]
Dtraining_gpu_test.py49 … 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
Dcompile_utils_test.py345 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/libopus/training/
Drnn_train.py28 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), '…
Drnn_dump.py35 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/
Ddump_rnn.py32 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)
Drnn_train.py19 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/saving/saved_model/
Drevive_test.py367 y_true = np.random.random((5, 3)).astype(np.float32)
368 model.train_on_batch(x, y_true)
372 self.assertAllClose(model.test_on_batch(x, y_true),
373 revived.test_on_batch(x, y_true))
377 y_true = np.random.randint(0, 3, (5, 1)).astype(np.float32)
378 model.train_on_batch(x, y_true)
381 self.assertAllClose(model.test_on_batch(x, y_true),
382 revived.test_on_batch(x, y_true))

12345678