/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 670 y_pred = ops.convert_to_tensor(y_pred) 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) [all …]
|
D | metrics_functional_test.py | 43 y_pred = K.variable(np.random.random((6, 7))) 44 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) 48 y_pred = K.variable([[0.8, 0.2], [0.6, 0.4], [0.7, 0.3], [0.9, 0.1]]) 49 print(K.eval(metric(y_true, y_pred))) 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 print(K.eval(metric(y_true, y_pred))) 56 self.assertAllEqual(K.eval(metric(y_true, y_pred)), [0., 1., 1., 1.]) 62 y_pred = K.variable(np.random.random((6, 7))) 63 self.assertEqual(K.eval(metric(y_true, y_pred)).shape, (6,)) [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)) 143 y_pred = keras.backend.variable(np.array([[0.3, 0.2, 0.1], 147 loss = keras.backend.eval(keras.losses.categorical_hinge(y_true, y_pred)) 192 y_pred = constant_op.constant([[4., 8.], [12., 3.]]) 194 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight) 221 y_pred = constant_op.constant([4, 8, 12, 8, 1, 3], 224 loss = mse_obj(y_true, y_pred) 230 y_pred = constant_op.constant([4, 8, 12, 8, 1, 3], [all …]
|
D | metrics_confusion_matrix_test.py | 58 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 61 update_op = fp_obj.update_state(y_true, y_pred) 71 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 74 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 81 y_pred = constant_op.constant(((0.9, 0.2, 0.8, 0.1), (0.2, 0.9, 0.7, 0.6), 86 update_op = fp_obj.update_state(y_true, y_pred) 95 y_pred = constant_op.constant(((0.9, 0.2, 0.8, 0.1), (0.2, 0.9, 0.7, 0.6), 102 result = fp_obj(y_true, y_pred, sample_weight=sample_weight) 138 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 141 update_op = fn_obj.update_state(y_true, y_pred) [all …]
|
D | metrics.py | 479 def update_state(self, y_true, y_pred, sample_weight=None): argument 493 y_pred = math_ops.cast(y_pred, self._dtype) 494 y_pred, y_true, sample_weight = squeeze_or_expand_dimensions( 495 y_pred, y_true, sample_weight) 497 y_pred, self.normalizer = confusion_matrix.remove_squeezable_dimensions( 498 y_pred, self.normalizer) 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 546 y_pred = math_ops.cast(y_pred, self._dtype) [all …]
|
D | metrics_test.py | 470 y_pred = self.l2_norm(self.np_y_pred, axis) 471 self.expected_loss = np.sum(np.multiply(y_true, y_pred), axis=(axis,)) 474 self.y_pred = constant_op.constant(self.np_y_pred) 491 loss = cosine_obj(self.y_true, self.y_pred) 502 self.y_pred, 512 loss = cosine_obj(self.y_true, self.y_pred) 535 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 538 update_op = mae_obj.update_state(y_true, y_pred) 548 y_pred = constant_op.constant(((0, 0, 1, 1, 0), (1, 1, 1, 1, 1), 551 result = mae_obj(y_true, y_pred, sample_weight=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 | metrics_utils.py | 214 y_pred, argument 264 y_pred = math_ops.cast(y_pred, dtype=dtypes.float32) 265 y_pred.shape.assert_is_compatible_with(y_true.shape) 285 y_pred, 286 math_ops.cast(0.0, dtype=y_pred.dtype), 289 y_pred, 290 math_ops.cast(1.0, dtype=y_pred.dtype), 293 y_pred, y_true, sample_weight = squeeze_or_expand_dimensions( 294 y_pred, y_true, sample_weight) 297 y_pred = _filter_top_k(y_pred, top_k) [all …]
|
D | losses_utils.py | 60 def squeeze_or_expand_dimensions(y_pred, y_true, sample_weight): argument 83 y_pred_shape = y_pred.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) 103 is_last_dim_1 = math_ops.equal(1, array_ops.shape(y_pred)[-1]) 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 | tf_utils_test.py | 137 def custom_loss(y_obs, y_pred): argument 139 obtained_prediction_box[0] = y_pred 140 return y_pred
|
/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 165 if len(y_pred.shape) > 1: 166 y_pred = np.squeeze(y_pred) 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/losses/python/metric_learning/ |
D | metric_loss_ops_test.py | 431 y_pred = cluster_ics 433 if sum(y_pred == cluster_idx) == 0: 439 pdists[medoid_ics[cluster_idx], y_pred == cluster_idx]) + 441 y_gt, y_pred))) 443 pdist_in = pdists[y_pred == cluster_idx, :] 444 pdist_in = pdist_in[:, y_pred == cluster_idx] 448 for i in range(y_pred.size): 449 if y_pred[i] != cluster_idx: 465 y_pred == cluster_idx)[0][max_score_idx]
|
/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/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/mixed_precision/experimental/ |
D | keras_test.py | 280 def loss_fn(y_true, y_pred): argument 282 return math_ops.reduce_mean(y_pred) 358 def loss_fn(y_true, y_pred): argument 360 self.assertEqual(y_pred.dtype, dtypes.float32) 361 return math_ops.reduce_mean(y_pred)
|