/external/tensorflow/tensorflow/python/ops/ |
D | nn_xent_test.py | 40 def _SigmoidCrossEntropyWithLogits(self, logits, targets): argument 41 assert len(logits) == len(targets) 42 pred = [1 / (1 + exp(-x)) for x in logits] 52 logits = constant_op.constant(x, shape=sizes, dtype=dtype, name="logits") 55 return logits, targets, losses 60 logits, targets, _ = self._Inputs() 62 labels=targets, logits=logits, name="mylogistic") 69 logits, targets, losses = self._Inputs(dtype=dtype) 71 labels=targets, logits=logits) 80 logits, targets, losses = self._Inputs(dtype=dtype, sizes=[2, 2, 2]) [all …]
|
D | ctc_ops.py | 82 logits=None): argument 194 logits, 205 logits=None, argument 217 inputs = deprecation.deprecated_argument_lookup("logits", logits, "inputs", 629 def ctc_loss_and_grad(logits, labels, label_length, logit_length, unique=None): argument 653 num_labels = _get_dim(logits, 2) 656 ilabel_log_probs = nn_ops.log_softmax(logits) 679 max_logit_length = _get_dim(logits, 0) 697 def _ctc_loss_op_standard(labels, logits, logit_length, logits_time_major, argument 699 part_before = logits[:, :, :blank_index] [all …]
|
D | nn_impl.py | 118 logits=None, 164 labels, logits) 167 with ops.name_scope(name, "logistic_loss", [logits, labels]) as name: 168 logits = ops.convert_to_tensor(logits, name="logits") 171 labels.get_shape().assert_is_compatible_with(logits.get_shape()) 174 (logits.get_shape(), labels.get_shape())) 184 zeros = array_ops.zeros_like(logits, dtype=logits.dtype) 185 cond = (logits >= zeros) 186 relu_logits = array_ops.where(cond, logits, zeros) 187 neg_abs_logits = array_ops.where(cond, -logits, logits) [all …]
|
/external/tensorflow/tensorflow/python/ops/distributions/ |
D | bernoulli.py | 52 logits=None, argument 86 logits=logits, 104 def logits(self): member in Bernoulli 139 event = math_ops.cast(event, self.logits.dtype) 140 logits = self.logits 144 def _broadcast(logits, event): argument 145 return (array_ops.ones_like(event) * logits, 146 array_ops.ones_like(logits) * event) 149 logits.get_shape().is_fully_defined() and 150 event.get_shape() == logits.get_shape()): [all …]
|
D | categorical.py | 163 logits=None, argument 194 with ops.name_scope(name, values=[logits, probs]) as name: 196 logits=logits, 250 def logits(self): member in Categorical 263 return self.logits.get_shape()[:-1] 272 if self.logits.get_shape().ndims == 2: 273 logits_2d = self.logits 275 logits_2d = array_ops.reshape(self.logits, [-1, self.event_size]) 311 k, logits = _broadcast_cat_event_and_params( 312 k, self.logits, base_dtype=self.dtype.base_dtype) [all …]
|
D | multinomial.py | 162 logits=None, argument 195 with ops.name_scope(name, values=[total_count, logits, probs]) as name: 202 logits=logits, 225 def logits(self): member in Multinomial 252 self.logits[..., 0], dtype=n_draws.dtype) * n_draws 253 logits = array_ops.ones_like( 254 n_draws[..., array_ops.newaxis], dtype=self.logits.dtype) * self.logits 257 flat_logits = array_ops.reshape(logits, [-1, k]) # [B1B2...Bm, k] 262 logits, n_draw = args[0], args[1] # [K], [] 263 x = random_ops.multinomial(logits[array_ops.newaxis, ...], n_draw, [all …]
|
/external/tensorflow/tensorflow/examples/speech_commands/ |
D | models_test.py | 56 logits, dropout_rate = models.create_model( 58 self.assertIsNotNone(logits) 60 self.assertIsNotNone(sess.graph.get_tensor_by_name(logits.name)) 68 logits = models.create_model(fingerprint_input, model_settings, "conv", 70 self.assertIsNotNone(logits) 71 self.assertIsNotNone(sess.graph.get_tensor_by_name(logits.name)) 78 logits, dropout_rate = models.create_model( 80 self.assertIsNotNone(logits) 82 self.assertIsNotNone(sess.graph.get_tensor_by_name(logits.name)) 90 logits, dropout_rate = models.create_model( [all …]
|
/external/tensorflow/tensorflow/python/kernel_tests/random/ |
D | multinomial_op_test.py | 40 def composed_sampler(logits, num_samples): argument 42 unif = random_ops.random_uniform(logits.get_shape().concatenate( 46 logits = array_ops.expand_dims(logits, -1) 49 return math_ops.argmax(logits + noise, axis=1) 63 logits = constant_op.constant([[-10., 10., -10.], [-10., -10., 10.]]) 66 logits, num_samples, output_dtype=output_dtype)) 102 logits = np.array([[1000.] * 5]) 104 logits *= -1 105 samples = self.evaluate(random_ops.multinomial(logits, 10)) 121 logits = np.log(probs).astype(np.float32) [all …]
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | losses_test.py | 120 logits = constant_op.constant([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], 125 losses.softmax_cross_entropy(labels, logits, weights=None) 130 logits = constant_op.constant([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], 133 loss = losses.softmax_cross_entropy(labels, logits) 139 logits = constant_op.constant([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], 144 loss = losses.softmax_cross_entropy(labels, logits) 150 logits = constant_op.constant([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], 155 loss = losses.softmax_cross_entropy(labels, logits, weights) 160 logits = constant_op.constant([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], 165 loss = losses.softmax_cross_entropy(labels, logits, [all …]
|
D | ctc_loss_op_test.py | 77 logits=inputs, 323 logits = random_ops.random_uniform([num_frames, batch_size, num_labels]) 333 t.watch(logits) 336 logits=logits, 339 ref_grad = t.gradient(ref_loss, [logits]) 348 grad = gradients_impl.gradients(loss, [logits]) 355 logits=logits, 370 logits = random_ops.random_uniform([num_frames, batch_size, num_labels]) 385 logits=logits, 388 ctc_loss_grads = gradients_impl.gradients(ctc_loss, [logits])[0] [all …]
|
D | sparse_xent_op_test.py | 151 labels=[[0, 2]], logits=[[0., 1.], [2., 3.], [2., 3.]]) 157 labels=constant_op.constant(0), logits=constant_op.constant(1.0)) 163 labels=labels, logits=[[7.]]) 170 labels=constant_op.constant(0), logits=constant_op.constant([1.0])) 208 labels=l, logits=f, name="xent") 238 labels=l, logits=f, name="xent"), [f])[0] 243 labels=l, logits=f, name="xent"), [f])[0] 266 labels=labels, logits=features) 275 labels=labels, logits=features), [features])[0] 297 logits = array_ops.placeholder(dtypes.float32, shape=[None, 3]) [all …]
|
/external/tensorflow/tensorflow/python/ops/losses/ |
D | losses_impl.py | 321 def hinge_loss(labels, logits, weights=1.0, scope=None, argument 355 if logits is None: 357 with ops.name_scope(scope, "hinge_loss", (logits, labels, weights)) as scope: 358 logits = math_ops.cast(logits, dtype=dtypes.float32) 360 logits.get_shape().assert_is_compatible_with(labels.get_shape()) 365 math_ops.subtract(all_ones, math_ops.multiply(labels, logits))) 659 multi_class_labels, logits, weights=1.0, label_smoothing=0, scope=None, argument 703 if logits is None: 706 (logits, multi_class_labels, weights)) as scope: 707 logits = ops.convert_to_tensor(logits) [all …]
|
/external/tensorflow/tensorflow/core/kernels/ |
D | sparse_xent_op.cc | 57 const Tensor& logits = context->input(0); in Compute() local 59 OP_REQUIRES(context, TensorShapeUtils::IsMatrix(logits.shape()), in Compute() 61 logits.shape().DebugString())); in Compute() 65 OP_REQUIRES(context, logits.dim_size(0) == labels.dim_size(0), in Compute() 69 logits.shape().DebugString(), " and labels shape ", in Compute() 71 OP_REQUIRES(context, logits.dim_size(1) > 0, in Compute() 74 logits.shape().DebugString())); in Compute() 85 {0}, 1, logits.shape(), &back_out)); in Compute() 87 if (logits.dim_size(0) > 0) { in Compute() 90 context, CheckInvalidLabelIndex<Index>(labels, logits.dim_size(1))); in Compute() [all …]
|
D | sparse_xent_op_gpu.cu.cc | 42 typename TTypes<T>::ConstMatrix logits, in Compute() 46 const int rows = logits.dimension(kBatchDim); in Compute() 47 const int cols = logits.dimension(kClassDim); in Compute() 53 ctx, maximum.data(), logits.data(), 2, rows, cols, 1, 1, constants.kOne, in Compute() 62 void operator()(OpKernelContext* ctx, typename TTypes<T>::ConstMatrix logits, in operator ()() 66 SparseXentEigenImpl<GPUDevice, T, Index>::Compute(ctx, logits, labels, in operator ()()
|
D | softmax_op_functor.h | 34 void operator()(const Device& d, typename TTypes<T>::ConstMatrix logits, 44 static void Compute(const Device& d, typename TTypes<T>::ConstMatrix logits, in Compute() 49 const int batch_size = logits.dimension(kBatchDim); in Compute() 50 const int num_classes = logits.dimension(kClassDim); in Compute() 66 auto shifted_logits = (logits - logits.maximum(along_class) in Compute()
|
D | sparse_xent_op.h | 60 typename TTypes<const T, 2>::Tensor32Bit logits, in SparseXentLossGenerator() argument 64 : logits_(logits), in SparseXentLossGenerator() 139 typename TTypes<T>::ConstMatrix logits, in Compute() 148 To32Bit(maximum).device(d) = To32Bit(logits).maximum(along_row); in Compute() 162 void operator()(OpKernelContext* ctx, typename TTypes<T>::ConstMatrix logits, 174 typename TTypes<T>::ConstMatrix logits, in Compute() 186 const int batch_size = logits.dimension(kBatchDim); in Compute() 187 const int num_classes = logits.dimension(kClassDim); in Compute() 213 RowMaxReduction<Device, T>::Compute(ctx, logits, scratch); in Compute() 218 To32Bit(logits) - in Compute()
|
/external/tensorflow/tensorflow/python/kernel_tests/distributions/ |
D | categorical_test.py | 41 logits = random_ops.random_uniform( 43 return categorical.Categorical(logits, dtype=dtype) 54 self.assertAllEqual([2], dist.logits.get_shape()) 59 logits = np.log(p) - 50. 60 dist = categorical.Categorical(logits=logits) 63 self.assertAllEqual([2], dist.logits.get_shape()) 65 self.assertAllClose(dist.logits, logits) 101 self.assertEqual(dist.logits.dtype, dtypes.float32) 102 self.assertEqual(dist.logits.dtype, dist.entropy().dtype) 104 dist.logits.dtype, dist.prob(np.array( [all …]
|
/external/tensorflow/tensorflow/lite/kernels/ |
D | multinomial.cc | 37 const FloatType* logits, int logits_size, in MultinomialSample() argument 48 max_logit = std::max(max_logit, logits[i]); in MultinomialSample() 52 FloatType odds = std::exp(logits[i] - max_logit) + last_odds; in MultinomialSample() 76 const FloatType* logits, int logits_size, in MultinomialSample() argument 82 rng, logits, logits_size, in MultinomialSample() 87 rng, logits, logits_size, in MultinomialSample() 100 const TfLiteTensor* logits, int logits_offset, in MultinomialSample() argument 103 switch (logits->type) { in MultinomialSample() 112 context, rng, GetTensorData<float>(logits) + logits_offset, in MultinomialSample() 119 context, rng, GetTensorData<double>(logits) + logits_offset, in MultinomialSample() [all …]
|
D | multinomial_test.cc | 57 MultinomialOpModel(tflite::TensorData logits, int num_samples, in MultinomialOpModel() argument 59 logits_ = AddInput(logits); in MultinomialOpModel() 70 int logits() { return logits_; } in logits() function in tflite::__anon1d5c03730111::MultinomialOpModel 109 m.PopulateTensor<Float>(m.logits(), in TYPED_TEST() 140 m.PopulateTensor<Float>(m.logits(), in TYPED_TEST() 165 m.logits(), {static_cast<Float>(-1000.0f), static_cast<Float>(-1000.0f), in TYPED_TEST() 188 std::vector<Float> logits(kNumLogits, static_cast<Float>(0.0f)); in TYPED_TEST() local 189 m.PopulateTensor<Float>(m.logits(), logits); in TYPED_TEST() 214 std::vector<Float> logits( in TYPED_TEST() local 216 m.PopulateTensor<Float>(m.logits(), logits); in TYPED_TEST()
|
/external/tensorflow/tensorflow/python/eager/benchmarks/resnet50/ |
D | hvp_test.py | 37 logits = model(images, training=True) 39 logits=logits, onehot_labels=labels) 49 logits = model(images, training=True) 51 logits=logits, onehot_labels=labels) 57 logits = model(images, training=True) 59 logits=logits, onehot_labels=labels) 70 logits = model(images, training=True) 72 logits=logits, onehot_labels=labels)
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
D | softmax_op.cc | 43 xla::XlaOp logits, bool log) { in BuildSoftmaxCustomCall() argument 44 TF_ASSIGN_OR_RETURN(xla::Shape logits_shape, b->GetShape(logits)); in BuildSoftmaxCustomCall() 45 return xla::CustomCallWithLayout(b, log ? "log_softmax" : "softmax", {logits}, in BuildSoftmaxCustomCall() 69 auto logits = ctx->Input(0); in Compile() local 76 b->ReportErrorOrReturn(BuildSoftmaxCustomCall(b, logits, log_)); in Compile() 85 xla::Reduce(logits, xla::MinValue(b, xla_type), max_func, {kClassDim}); in Compile() 88 auto shifted_logits = xla::Sub(logits, logits_max, batch_dims); in Compile() 118 xla::XlaOp logits, xla::XlaOp labels) { in CrossEntropyWithLogits() argument 127 xla::Reduce(logits, xla::MinValue(b, xla_type), max_func, {kClassDim}); in CrossEntropyWithLogits() 131 auto shifted_logits = xla::Sub(logits, logits_max, {kBatchDim}); in CrossEntropyWithLogits() [all …]
|
/external/tensorflow/tensorflow/python/tpu/ |
D | async_checkpoint_test.py | 69 logits = math_ops.matmul(features, w) 70 loss = losses.sparse_softmax_cross_entropy(labels=labels, logits=logits) 83 def metric_fn(labels, logits): argument 85 logging.info('LABELS %s %s', labels, logits) 87 'recall@1': metrics_lib.recall_at_k(labels, logits, 1), 88 'recall@5': metrics_lib.recall_at_k(labels, logits, 5), 91 loss = losses.sparse_softmax_cross_entropy(labels=labels, logits=logits) 92 eval_metrics = (metric_fn, [labels, logits])
|
/external/tensorflow/tensorflow/core/api_def/base_api/ |
D | api_def_BoostedTreesPredict.pbtxt | 12 name: "logits" 14 Output rank 2 Tensor containing logits for each example. 26 scalar, dimension of the logits, to be used for partial logits 32 computes the logits. It is designed to be used during prediction.
|
D | api_def_Softmax.pbtxt | 4 name: "logits" 12 Same shape as `logits`. 19 $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$
|
D | api_def_LogSoftmax.pbtxt | 4 name: "logits" 12 Same shape as `logits`. 19 logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
|