Home
last modified time | relevance | path

Searched refs:loss_fn (Results 1 – 25 of 37) sorted by relevance

12

/external/tensorflow/tensorflow/contrib/gan/python/losses/python/
Dtuple_losses_impl.py89 def _args_to_gan_model(loss_fn): argument
104 argspec = tf_inspect.getargspec(loss_fn)
134 arg, loss_fn.__name__))
141 'for %s: %s' % (loss_fn.__name__, ambiguous_args))
158 return loss_fn(**kwargs)
160 new_docstring = """The gan_model version of %s.""" % loss_fn.__name__
162 new_loss_fn.__name__ = loss_fn.__name__
163 new_loss_fn.__module__ = loss_fn.__module__
285 def stargan_generator_loss_wrapper(loss_fn): argument
300 return loss_fn(
[all …]
Dtuple_losses_test.py72 def loss_fn(x): function
74 new_loss_fn = tfgan_losses._args_to_gan_model(loss_fn)
84 loss_fn = tfgan_losses._args_to_gan_model(args_loss)
85 loss = loss_fn(tuple_type(arg1=-1, arg2=2), arg3=4)
99 loss_fn = tfgan_losses._args_to_gan_model(args_loss)
100 loss = loss_fn(InheritedType(arg1=-1, arg2=2), arg3=4)
237 loss_fn = tfgan_losses_impl.wasserstein_generator_loss
238 wrapped_loss_fn = tfgan_losses.stargan_generator_loss_wrapper(loss_fn)
240 loss_result_tensor = loss_fn(
252 loss_fn = tfgan_losses_impl.wasserstein_discriminator_loss
[all …]
/external/tensorflow/tensorflow/contrib/layers/python/layers/
Dtarget_column.py55 loss_fn=_mean_squared_loss,
90 loss_fn = _log_loss_with_two_classes
92 loss_fn = _softmax_cross_entropy_loss
94 loss_fn=loss_fn,
151 def __init__(self, loss_fn, num_label_columns, label_name, weight_column_name, argument
153 if not loss_fn:
158 self._loss_fn = loss_fn
266 def __init__(self, loss_fn, label_name, weight_column_name, label_dimension): argument
268 loss_fn=loss_fn,
294 def __init__(self, loss_fn, n_classes, label_name, weight_column_name): argument
[all …]
/external/tensorflow/tensorflow/contrib/learn/python/learn/estimators/
Dhead.py226 loss_fn=_mean_squared_loss,
263 loss_fn=_poisson_loss,
277 loss_fn=None, argument
322 if loss_fn:
323 _verify_loss_fn_args(loss_fn)
325 loss_fn = _wrap_custom_loss_fn(loss_fn) if loss_fn else None
337 loss_fn=loss_fn)
347 loss_fn=loss_fn,
395 loss_fn=None): argument
434 if loss_fn:
[all …]
/external/tensorflow/tensorflow/contrib/distribute/python/
Dsingle_loss_example.py41 def loss_fn(ctx, x): function
47 dataset_fn, loss_fn, optimizer, distribution, iterations_per_step)
75 def loss_fn(): function
82 return optimizer.minimize(loss_fn)
84 return optimizer.minimize(loss_fn())
112 def loss_fn(): function
123 return optimizer.minimize(loss_fn)
Dstep_fn.py88 def __init__(self, dataset_fn, loss_fn, optimizer, distribution, argument
91 self._loss_fn = loss_fn
Dminimize_loss_test.py296 def loss_fn(): function
307 return optimizer.minimize(loss_fn)
309 return optimizer.minimize(loss_fn())
388 def loss_fn(): function
392 train_op = optimizer.minimize(loss_fn)
393 loss = loss_fn()
Dkeras_optimizer_v2_test.py65 def loss_fn(): function
69 train_op = optimizer.minimize(loss_fn, var_list=[var])
/external/tensorflow/tensorflow/python/keras/engine/
Dtraining_eager.py37 def _eager_loss_fn(outputs, targets, loss_fn, output_name): argument
39 loss = loss_fn(targets, outputs)
116 for i, loss_fn in enumerate(model.loss_functions):
136 if hasattr(loss_fn, 'reduction'):
137 current_loss_reduction = loss_fn.reduction
138 loss_fn.reduction = losses_utils.ReductionV2.NONE
139 weighted_losses = loss_fn(targets[i], outs[i], sample_weight=weights)
140 loss_fn.reduction = current_loss_reduction
150 output_loss = loss_fn(targets[i], outs[i], sample_weight=weights)
Dtraining.py1652 for i, (y_true, y_pred, loss_fn, sample_weight, mask,
1675 if hasattr(loss_fn, 'reduction'):
1676 current_loss_reduction = loss_fn.reduction
1677 loss_fn.reduction = losses_utils.ReductionV2.NONE
1678 weighted_losses = loss_fn(
1680 loss_fn.reduction = current_loss_reduction
1691 output_loss = loss_fn(y_true, y_pred, sample_weight=sample_weight)
1947 metrics_module.SumOverBatchSize() if hasattr(loss_fn, 'reduction')
1948 else metrics_module.SumOverBatchSizeMetricWrapper(loss_fn)
1949 for loss_fn in self.loss_functions
[all …]
Dtraining_utils.py581 metric, output_shape=output_shapes[i], loss_fn=loss_fns[i])
773 def get_metric_function(metric, output_shape=None, loss_fn=None): argument
789 isinstance(loss_fn, losses.SparseCategoricalCrossentropy) or
790 (isinstance(loss_fn, losses.LossFunctionWrapper) and
791 loss_fn.fn == losses.sparse_categorical_crossentropy))
794 isinstance(loss_fn, losses.BinaryCrossentropy) or
795 (isinstance(loss_fn, losses.LossFunctionWrapper) and
796 loss_fn.fn == losses.binary_crossentropy))
846 loss_fn = losses.get(loss)
847 return losses.LossFunctionWrapper(loss_fn, name=loss_fn.__name__)
/external/tensorflow/tensorflow/contrib/boosted_trees/estimator_batch/
Destimator.py107 def loss_fn(labels, logits, weights=None): function
115 loss_fn = None
120 loss_fn=loss_fn,
489 loss_fn=functools.partial(
531 def loss_fn(labels, logits): function
540 loss_fn=loss_fn,
557 def loss_fn(labels, logits): function
569 loss_fn=loss_fn,
Dcustom_loss_head.py31 loss_fn, argument
57 weighted_loss, _ = loss_fn(labels, weight_tensor, logits)
62 loss_fn=loss_wrapper,
Ddnn_tree_combined_estimator.py275 loss_weight, loss_fn = dnn_to_tree_distillation_param
285 if loss_fn is None:
289 loss_fn = distillation_loss.create_dnn_to_tree_cross_entropy_loss_fn(
292 dnn_to_tree_distillation_loss = loss_weight * loss_fn(
/external/tensorflow/tensorflow/contrib/eager/python/examples/l2hmc/
Dmain.py74 loss_fn = tfe.function(l2hmc.compute_loss)
76 loss_fn = l2hmc.compute_loss
84 loss_fn=loss_fn,
153 loss_fn=l2hmc.compute_loss, argument
157 dynamics, x, loss_fn=loss_fn)
Dl2hmc_test.py42 dynamics, samples, loss_fn=l2hmc.compute_loss)
53 dynamics, samples, loss_fn=l2hmc.compute_loss)
/external/tensorflow/tensorflow/contrib/distribute/python/examples/
Dsimple_estimator_example.py45 def loss_fn(): function
53 mode, loss=loss_fn(), eval_metric_ops={"Accuracy": acc_obj})
58 train_op = optimizer.minimize(loss_fn(), global_step=global_step)
59 return tf.estimator.EstimatorSpec(mode, loss=loss_fn(), train_op=train_op)
/external/tensorflow/tensorflow/contrib/gan/python/estimator/python/
Dlatent_gan_estimator_impl.py93 def _get_latent_gan_model_fn(generator_fn, discriminator_fn, loss_fn, argument
115 loss = loss_fn(gan_model, features, labels, add_summaries)
138 def get_latent_gan_estimator(generator_fn, discriminator_fn, loss_fn, argument
188 loss_fn, optimizer)
Dstargan_estimator_impl.py101 loss_fn=None, argument
151 if not callable(loss_fn):
180 return _get_estimator_spec(mode, gan_model, loss_fn,
209 loss_fn, argument
219 gan_loss = loss_fn(gan_model)
Dstargan_estimator_test.py178 loss_fn=dummy_loss_fn,
224 loss_fn=dummy_loss_fn,
/external/tensorflow/tensorflow/contrib/distributions/python/ops/
Destimator.py149 def loss_fn(labels, logits, weights=None): function
172 loss_fn=loss_fn,
/external/tensorflow/tensorflow/contrib/eager/python/
Dsaver_test.py147 loss_fn = lambda: v[0, 0] ** 2 + v[0, 1] ** 2 function
148 optimizer.minimize(loss_fn)
152 optimizer.minimize(loss_fn)
157 optimizer.minimize(loss_fn)
/external/tensorflow/tensorflow/python/keras/mixed_precision/experimental/
Dkeras_test.py280 def loss_fn(y_true, y_pred): function
288 model.compile(opt, loss=loss_fn)
358 def loss_fn(y_true, y_pred): function
366 model.compile(opt, loss=loss_fn)
/external/tensorflow/tensorflow/contrib/eager/python/examples/rnn_ptb/
Drnn_ptb_graph_test.py46 loss = rnn_ptb.loss_fn(model, inputs_ph, labels_ph, training=True)
132 loss = rnn_ptb.loss_fn(model, inputs, labels, training=True)
Drnn_ptb.py155 def loss_fn(model, inputs, targets, training): function
185 loss = loss_fn(model, inp, target, training=False)
198 return loss_fn(model, inputs, targets, training=True)

12