Home
last modified time | relevance | path

Searched refs:sample_weight (Results 1 – 25 of 166) sorted by relevance

1234567

/external/tensorflow/tensorflow/python/ops/losses/
Dutil.py34 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument
84 if sample_weight is None:
87 weights_shape = sample_weight.shape
90 return y_pred, y_true, sample_weight
95 sample_weight = array_ops.squeeze(sample_weight, [-1])
97 sample_weight = array_ops.expand_dims(sample_weight, [-1])
98 return y_pred, y_true, sample_weight
101 weights_rank_tensor = array_ops.rank(sample_weight)
103 maybe_squeeze_weights = lambda: array_ops.squeeze(sample_weight, [-1])
106 expand_weights = lambda: array_ops.expand_dims(sample_weight, [-1])
[all …]
/external/tensorflow/tensorflow/python/keras/
Dlosses_test.py199 sample_weight = constant_op.constant([1.2, 0.5])
200 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight)
223 sample_weight = constant_op.constant([1.2, 0.5])
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)
229 loss = tf_functioned_loss_fn(y_true, y_pred, sample_weight=sample_weight)
335 loss = mse_obj(y_true, y_pred, sample_weight=2.3)
344 sample_weight = constant_op.constant([1.2, 3.4], shape=(2, 1))
345 loss = mse_obj(y_true, y_pred, sample_weight=sample_weight)
353 sample_weight = constant_op.constant([1.2, 0.5])
[all …]
Dmetrics_test.py88 result_t = m(100, sample_weight=0.5)
93 result_t = m([1, 5], sample_weight=[1, 0.2])
99 result_t = m([1, 2], sample_weight=0.5)
104 result_t = m([1, 5], sample_weight=[[1], [0.2]])
109 result_t = m([[1], [5]], sample_weight=[1, 0.2])
114 result_t = m([[[1., 2.], [3., 2.], [0.5, 4.]]], sample_weight=[0.5])
128 result_t = m(v, sample_weight=w)
236 result_t = m(100, sample_weight=0.5)
242 result_t = m([1, 5], sample_weight=[1, 0.2])
249 result_t = m([1, 2], sample_weight=0.5)
[all …]
Dmetrics_correctness_test.py197 sample_weight={
209 sample_weight={'output_2': self.sample_weight_2},
227 sample_weight={
238 sample_weight={
248 mse1 = model.evaluate([x, x], [y, y], sample_weight=[w, w], batch_size=5)[3]
249 mse2 = model.evaluate([x, x], [y, y], sample_weight=[w, w],
261 sample_weight={
269 sample_weight={
283 sample_weight={
291 sample_weight={
[all …]
Dmetrics.py367 def update_state(self, values, sample_weight=None): argument
377 [values], sample_weight = \
379 [values], sample_weight)
381 if sample_weight is not None:
382 sample_weight = math_ops.cast(sample_weight, self._dtype)
384 values, _, sample_weight = losses_utils.squeeze_or_expand_dimensions(
385 values, sample_weight=sample_weight)
388 sample_weight = weights_broadcast_ops.broadcast_weights(
389 sample_weight, values)
393 weight_ndim = K.ndim(sample_weight)
[all …]
Dmetrics_confusion_matrix_test.py76 sample_weight = constant_op.constant((1., 1.5, 2., 2.5))
77 result = fp_obj(y_true, y_pred, sample_weight=sample_weight)
102 sample_weight = ((1.0, 2.0, 3.0, 5.0), (7.0, 11.0, 13.0, 17.0),
105 result = fp_obj(y_true, y_pred, sample_weight=sample_weight)
156 sample_weight = constant_op.constant((1., 1.5, 2., 2.5))
157 result = fn_obj(y_true, y_pred, sample_weight=sample_weight)
182 sample_weight = ((3.0,), (5.0,), (7.0,), (4.0,))
184 result = fn_obj(y_true, y_pred, sample_weight=sample_weight)
224 sample_weight = constant_op.constant((1., 1.5, 2., 2.5))
225 result = tn_obj(y_true, y_pred, sample_weight=sample_weight)
[all …]
/external/tensorflow/tensorflow/python/keras/utils/
Dlosses_utils.py146 def squeeze_or_expand_dimensions(y_pred, y_true=None, sample_weight=None): argument
196 if sample_weight is None:
199 weights_shape = sample_weight.shape
202 return y_pred, y_true, sample_weight
207 sample_weight = array_ops.squeeze(sample_weight, [-1])
209 sample_weight = array_ops.expand_dims(sample_weight, [-1])
210 return y_pred, y_true, sample_weight
213 weights_rank_tensor = array_ops.rank(sample_weight)
215 maybe_squeeze_weights = lambda: array_ops.squeeze(sample_weight, [-1])
218 expand_weights = lambda: array_ops.expand_dims(sample_weight, [-1])
[all …]
Dmetrics_utils.py242 sample_weight=None, argument
324 sample_weight)
345 if sample_weight is None:
349 sample_weight = math_ops.cast(sample_weight, dtype=variable_dtype)
350 y_pred, y_true, sample_weight = (
352 y_pred, y_true, sample_weight=sample_weight))
405 if sample_weight is not None:
406 sample_weight = weights_broadcast_ops.broadcast_weights(
407 math_ops.cast(sample_weight, dtype=variable_dtype), y_pred)
409 array_ops.reshape(sample_weight, thresh_tiles), data_tiles)
/external/tensorflow/tensorflow/python/keras/engine/
Dtraining_v1.py628 sample_weight=None, argument
808 sample_weight=sample_weight,
822 sample_weight=None, argument
916 sample_weight=sample_weight,
1013 sample_weight=None, argument
1069 x, y, sample_weight=sample_weight, class_weight=class_weight,
1104 def test_on_batch(self, x, y=None, sample_weight=None, reset_metrics=True): argument
1151 x, y, sample_weight=sample_weight, extract_tensors_from_dataset=True)
1388 sample_weight=val_sample_weights,
1594 sample_weight = endpoint.sample_weight
[all …]
Dcompile_utils.py168 sample_weight=None, argument
185 sample_weight = self._conform_to_outputs(y_pred, sample_weight)
192 sample_weight = nest.flatten(sample_weight)
197 zip_args = (y_true, y_pred, sample_weight, self._losses, self._loss_weights,
205 loss_value = loss_obj(y_t, y_p, sample_weight=sw)
219 metric_obj.update_state(loss_metric_value, sample_weight=batch_dim)
244 total_loss_metric_value, sample_weight=batch_dim)
403 def update_state(self, y_true, y_pred, sample_weight=None): argument
406 sample_weight = self._conform_to_outputs(y_pred, sample_weight)
413 sample_weight = nest.flatten(sample_weight)
[all …]
Dtraining_utils_v1.py727 def standardize_sample_weights(sample_weight, output_names): argument
728 return standardize_sample_or_class_weights(sample_weight, output_names,
949 sample_weight=None, argument
974 if isinstance(sample_weight, tuple):
975 sample_weight = sample_weight[0]
988 if sample_weight is not None and len(sample_weight.shape) != 2:
990 str(sample_weight.shape) + '. '
994 if sample_weight is not None and len(sample_weight.shape) != 1:
1001 sample_weight.shape, sample_weight_mode))
1003 if sample_weight is not None:
[all …]
Dtraining_generator_v1.py566 sample_weight=None, argument
576 y, sample_weight, validation_split=validation_split)
601 sample_weight=None, argument
608 training_utils_v1.check_generator_arguments(y, sample_weight)
656 sample_weight=None, argument
664 training_utils_v1.validate_dataset_input(x, y, sample_weight,
692 sample_weight=None, argument
698 training_utils_v1.validate_dataset_input(x, y, sample_weight)
736 sample_weight=None, argument
747 sample_weight=sample_weight,
[all …]
Dcompile_utils_test.py60 total_loss = loss_container(y_t, y_p, sample_weight=sw)
93 total_loss = loss_container(y_t, y_p, sample_weight=sw)
119 total_loss = loss_container(y_t, y_p, sample_weight=sw)
142 total_loss = loss_container(y_t, y_p, sample_weight=sw)
177 total_loss = loss_container(y_t, y_p, sample_weight=sw)
200 total_loss = loss_container(y_t, y_p, sample_weight=sw)
317 total_loss = loss_container(y_t, y_p, sample_weight=sw)
334 total_loss = loss_container(y_t, y_p, sample_weight=sw)
425 metric_container.update_state(y_t, y_p, sample_weight=sw)
480 metric_container.update_state(y_t, y_p, sample_weight=sw)
[all …]
Dtraining.py793 x, y, sample_weight = data_adapter.unpack_x_y_sample_weight(data)
798 y, y_pred, sample_weight, regularization_losses=self.losses)
800 self.compiled_metrics.update_state(y, y_pred, sample_weight)
880 sample_weight=None, argument
1087 (x, y, sample_weight), validation_data = (
1089 (x, y, sample_weight), validation_split=validation_split))
1105 sample_weight=sample_weight,
1174 sample_weight=val_sample_weight,
1187 sample_weight=val_sample_weight,
1234 x, y, sample_weight = data_adapter.unpack_x_y_sample_weight(data)
[all …]
Dtraining_distributed_v1.py594 sample_weight=None, argument
616 sample_weight=sample_weight,
626 sample_weight=sample_weight,
643 sample_weight=val_sample_weights,
695 sample_weight=None, argument
706 sample_weight=sample_weight,
Dtraining_arrays_v1.py613 sample_weight=None, argument
625 sample_weight=sample_weight,
672 sample_weight=None, argument
680 sample_weight=sample_weight,
Ddata_adapter.py856 x, y, sample_weight = unpack_x_y_sample_weight(data)
857 data = pack_x_y_sample_weight(x, y, sample_weight)
1106 sample_weight=None, argument
1165 sample_weights=sample_weight,
1574 def pack_x_y_sample_weight(x, y=None, sample_weight=None): argument
1609 elif sample_weight is None:
1612 return (x, y, sample_weight)
1618 sample_weight=None, argument
1621 x, y, sample_weight = _process_tensorlike((x, y, sample_weight))
1624 elif sample_weight is None:
[all …]
Dtraining_eager_v1.py175 mask, sample_weight=weights))
182 sample_weight=weights,
200 output_loss = loss_fn(targets[i], outs[i], sample_weight=weights)
/external/tensorflow/tensorflow/python/keras/tests/
Dtemporal_sample_weights_correctness_test.py260 sample_weight={
277 sample_weight={
302 sample_weight={
308 sample_weight={
322 sample_weight={
327 sample_weight={
350 sample_weight={
364 sample_weight={
386 sample_weight={
391 sample_weight={
[all …]
/external/tensorflow/tensorflow/python/keras/saving/
Dlosses_serialization_test.py142 sample_weight=[self.w, self.w])
147 sample_weight=[self.w, self.w])
155 [self.x, self.x], [self.y, self.y], sample_weight=[self.w, self.w])
169 sample_weight=[self.w, self.w])
174 sample_weight=[self.w, self.w])
189 sample_weight=[self.w, self.w])
Dmetrics_serialization_test.py188 sample_weight=[self.w, self.w])
193 sample_weight=[self.w, self.w])
201 [self.x, self.x], [self.y, self.y], sample_weight=[self.w, self.w])
228 sample_weight=[self.w, self.w])
233 sample_weight=[self.w, self.w])
248 sample_weight=[self.w, self.w])
/external/tensorflow/tensorflow/python/keras/premade/
Dwide_deep.py113 x, y, sample_weight = data_adapter.unpack_x_y_sample_weight(data)
114 x, y, sample_weight = data_adapter.expand_1d((x, y, sample_weight))
119 y, y_pred, sample_weight, regularization_losses=self.losses)
120 self.compiled_metrics.update_state(y, y_pred, sample_weight)
/external/tensorflow/tensorflow/python/keras/preprocessing/
Dimage.py433 sample_weight=None, argument
453 sample_weight=sample_weight,
822 sample_weight=None, argument
874 sample_weight=sample_weight,
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt11 …'x\', \'y\', \'image_data_generator\', \'batch_size\', \'shuffle\', \'sample_weight\', \'seed\', \…
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt11 …'x\', \'y\', \'image_data_generator\', \'batch_size\', \'shuffle\', \'sample_weight\', \'seed\', \…

1234567