/external/tensorflow/tensorflow/python/keras/ |
D | losses.py | 68 def __call__(self, y_true, y_pred, sample_weight=None): argument 95 (y_pred, y_true, sample_weight)): 96 losses = self.call(y_true, y_pred) 117 def call(self, y_true, y_pred): argument 148 def call(self, y_true, y_pred): argument 158 return self.fn(y_true, y_pred, **self._fn_kwargs) 669 def mean_squared_error(y_true, y_pred): argument 671 y_true = math_ops.cast(y_true, y_pred.dtype) 672 return K.mean(math_ops.squared_difference(y_pred, y_true), axis=-1) 681 def mean_absolute_error(y_true, y_pred): argument [all …]
|
D | losses_test.py | 59 def __call__(self, y_true, y_pred, sample_weight=None): argument 60 return (self.mse_fraction * keras.losses.mse(y_true, y_pred) + 61 (1 - self.mse_fraction) * keras.losses.mae(y_true, y_pred)) 145 y_true = keras.backend.variable(np.array([[0, 1, 0], [1, 0, 0]])) 147 loss = keras.backend.eval(keras.losses.categorical_hinge(y_true, y_pred)) 191 y_true = constant_op.constant([[1., 9.], [2., 5.]]) 194 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight) 214 y_true = constant_op.constant([4, 8, 12, 8, 1, 3], shape=(2, 3)) 215 loss = mse_obj(y_true, y_true) 220 y_true = constant_op.constant([1, 9, 2, -5, -2, 6], shape=(2, 3)) [all …]
|
D | metrics_functional_test.py | 42 y_true = K.variable(np.random.randint(0, 7, (6,))) 44 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) 47 y_true = K.variable([1., 0., 0., 0.]) 49 print(K.eval(metric(y_true, y_pred))) 50 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.]) 53 y_true = K.variable([[1.], [0.], [0.], [0.]]) 55 print(K.eval(metric(y_true, y_pred))) 56 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.]) 61 y_true = K.variable(np.random.random((6,))) 63 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) [all …]
|
D | metrics_confusion_matrix_test.py | 56 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1), 61 update_op = fp_obj.update_state(y_true, y_pred) 69 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1), 74 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 83 y_true = constant_op.constant(((0, 1, 1, 0), (1, 0, 0, 0), (0, 0, 0, 0), 86 update_op = fp_obj.update_state(y_true, y_pred) 97 y_true = constant_op.constant(((0, 1, 1, 0), (1, 0, 0, 0), (0, 0, 0, 0), 102 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 136 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1), 141 update_op = fn_obj.update_state(y_true, y_pred) [all …]
|
D | metrics_test.py | 469 y_true = self.l2_norm(self.np_y_true, axis) 471 self.expected_loss = np.sum(np.multiply(y_true, y_pred), axis=(axis,)) 473 self.y_true = constant_op.constant(self.np_y_true) 491 loss = cosine_obj(self.y_true, self.y_pred) 501 self.y_true, 512 loss = cosine_obj(self.y_true, self.y_pred) 533 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1), 538 update_op = mae_obj.update_state(y_true, y_pred) 546 y_true = constant_op.constant(((0, 1, 0, 1, 0), (0, 0, 1, 1, 1), 551 result = mae_obj(y_true, y_pred, sample_weight=sample_weight) [all …]
|
D | metrics.py | 479 def update_state(self, y_true, y_pred, sample_weight=None): argument 492 y_true = math_ops.cast(y_true, self._dtype) 494 y_pred, y_true, sample_weight = squeeze_or_expand_dimensions( 495 y_pred, y_true, sample_weight) 499 y_pred.shape.assert_is_compatible_with(y_true.shape) 501 math_ops.abs(y_true - y_pred), self.normalizer) 530 def update_state(self, y_true, y_pred, sample_weight=None): argument 545 y_true = math_ops.cast(y_true, self._dtype) 547 y_pred, y_true, sample_weight = squeeze_or_expand_dimensions( 548 y_pred, y_true, sample_weight) [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 | 149 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 153 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 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\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 173 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 177 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 185 …argspec: "args=[\'y_true\', \'y_pred\', \'axis\'], varargs=None, keywords=None, defaults=[\'-1\'],… [all …]
|
D | tensorflow.keras.losses.-loss.pbtxt | 11 argspec: "args=[\'self\', \'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None"
|
/external/tensorflow/tensorflow/tools/api/golden/v2/ |
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.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.keras.metrics.pbtxt | 149 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 153 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 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\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 173 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 177 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 193 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
D | tensorflow.metrics.pbtxt | 149 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 153 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 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\', \'threshold\'], varargs=None, keywords=None, defaults=[\'0… 173 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 177 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" 181 …argspec: "args=[\'y_true\', \'y_pred\', \'from_logits\', \'label_smoothing\'], varargs=None, keywo… 193 argspec: "args=[\'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None" [all …]
|
D | tensorflow.losses.-loss.pbtxt | 11 argspec: "args=[\'self\', \'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None"
|
D | tensorflow.keras.losses.-loss.pbtxt | 11 argspec: "args=[\'self\', \'y_true\', \'y_pred\'], varargs=None, keywords=None, defaults=None"
|
/external/tensorflow/tensorflow/python/keras/utils/ |
D | losses_utils.py | 60 def squeeze_or_expand_dimensions(y_pred, y_true, sample_weight): argument 85 if y_true is not None: 91 y_true_shape = y_true.get_shape() 96 y_true, y_pred = confusion_matrix.remove_squeezable_dimensions( 97 y_true, y_pred) 100 rank_diff = array_ops.rank(y_pred) - array_ops.rank(y_true) 102 y_true, y_pred) 105 is_last_dim_1, squeeze_dims, lambda: (y_true, y_pred)) 106 y_true, y_pred = control_flow_ops.cond( 110 return y_pred, y_true, None [all …]
|
D | metrics_utils.py | 213 y_true, argument 263 y_true = math_ops.cast(y_true, dtype=dtypes.float32) 265 y_pred.shape.assert_is_compatible_with(y_true.shape) 293 y_pred, y_true, sample_weight = squeeze_or_expand_dimensions( 294 y_pred, y_true, sample_weight) 299 y_true = y_true[..., class_id] 309 math_ops.cast(y_true, dtype=dtypes.bool), [1, -1])
|
/external/tensorflow/tensorflow/contrib/learn/python/learn/estimators/ |
D | _sklearn.py | 157 def _accuracy_score(y_true, y_pred): argument 158 score = y_true == y_pred 162 def _mean_squared_error(y_true, y_pred): argument 163 if len(y_true.shape) > 1: 164 y_true = np.squeeze(y_true) 167 return np.average((y_true - y_pred)**2)
|
/external/tensorflow/tensorflow/python/keras/engine/ |
D | training_gpu_test.py | 47 … loss = lambda y_true, y_pred: K.sparse_categorical_crossentropy( # pylint: disable=g-long-lambda argument 48 y_true, y_pred, axis=axis) 52 loss = lambda y_true, y_pred: K.categorical_crossentropy( # pylint: disable=g-long-lambda argument 53 y_true, y_pred, axis=axis) 57 …loss = lambda y_true, y_pred: K.binary_crossentropy(y_true, y_pred) # pylint: disable=unnecessary… argument
|
/external/tensorflow/tensorflow/contrib/integrate/python/ops/ |
D | odes_test.py | 54 y_true = np.exp(t) 55 self.assertAllClose(y_true, y_solved) 67 y_true = np.exp(k * t) 68 self.assertAllClose(y_true, y_solved) 79 y_true = 1.0 / (2.0 - t) + t 80 self.assertAllClose(y_true, y_solved) 102 y_true = np.zeros((len(t), 2, 1)) 103 y_true[:, 0, 0] = np.sin(4.0 * t) * np.exp(3.0 * t) 104 y_true[:, 1, 0] = np.cos(4.0 * t) * np.exp(3.0 * t) 105 self.assertAllClose(y_true, y_solved, atol=1e-5)
|
/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/contrib/seq2seq/python/ops/ |
D | loss.py | 160 def __call__(self, y_true, y_pred, sample_weight=None): argument 162 return sequence_loss(y_pred, y_true, sample_weight, 170 def call(self, y_true, y_pred): argument
|
/external/tensorflow/tensorflow/python/keras/layers/ |
D | local_test.py | 359 def xent(y_true, y_pred): argument 360 y_true = keras.backend.cast( 361 keras.backend.reshape(y_true, (-1,)), 365 labels=y_true,
|
/external/tensorflow/tensorflow/python/keras/mixed_precision/experimental/ |
D | keras_test.py | 280 def loss_fn(y_true, y_pred): argument 281 del y_true 358 def loss_fn(y_true, y_pred): argument 359 self.assertEqual(y_true.dtype, dtypes.float32)
|