/external/tensorflow/tensorflow/contrib/factorization/python/ops/ |
gmm_ops.py | 32 from tensorflow.python.ops import math_ops 56 num_points = math_ops.to_float(array_ops.shape(x)[0]) 57 x -= math_ops.reduce_mean(x, 0, keep_dims=True) 59 cov = math_ops.reduce_sum( 60 math_ops.square(x), 0, keep_dims=True) / (num_points - 1) 62 cov = math_ops.matmul(x, x, transpose_a=True) / (num_points - 1) 78 num_data = math_ops.add_n([array_ops.shape(inp)[0] for inp in data]) 84 maxval=math_ops.cast(num_data, dtypes.int64), 87 indices %= math_ops.cast(num_data, dtypes.int64) 250 ret.append(math_ops.argmax(w, 1) [all...] |
/external/tensorflow/tensorflow/contrib/model_pruning/python/ |
pruning.py | 73 from tensorflow.python.ops import math_ops 176 nbins_float = math_ops.cast(nbins, values.dtype) 179 scaled_values = math_ops.truediv( 186 indices = math_ops.floor(nbins_float * scaled_values, name='indices') 189 indices = math_ops.cast( 192 return math_ops.unsorted_segment_sum( 258 masked_weights = math_ops.multiply(mask, x, _MASKED_WEIGHT_NAME) 417 return math_ops.cast(graph_global_step, np.int32) 432 p = math_ops.minimum(1.0, 433 math_ops.maximum [all...] |
/external/tensorflow/tensorflow/contrib/metrics/python/ops/ |
metric_ops.py | 34 from tensorflow.python.ops import math_ops 60 math_ops.greater(denominator, 0), 61 math_ops.truediv(numerator, denominator), 565 predictions=math_ops.cast(predictions, dtype=dtypes.bool), 566 labels=math_ops.cast(labels, dtype=dtypes.bool), 586 math_ops.greater(fp + tn, 0), math_ops.div(fp, fp + tn), 0, name) 653 predictions=math_ops.cast(predictions, dtype=dtypes.bool), 654 labels=math_ops.cast(labels, dtype=dtypes.bool), 674 math_ops.greater(fn + tp, 0), math_ops.div(fn, fn + tp), 0, name [all...] |
/external/tensorflow/tensorflow/contrib/opt/python/training/ |
addsign.py | 24 from tensorflow.python.ops import math_ops 116 math_ops.cast(self._lr_t, var.dtype.base_dtype), 117 math_ops.cast(self._alpha_t, var.dtype.base_dtype), 118 math_ops.cast(self._sign_decay_t, var.dtype.base_dtype), 119 math_ops.cast(self._beta_t, var.dtype.base_dtype), 128 math_ops.cast(self._lr_t, var.dtype.base_dtype), 129 math_ops.cast(self._alpha_t, var.dtype.base_dtype), 130 math_ops.cast(self._sign_decay_t, var.dtype.base_dtype), 131 math_ops.cast(self._beta_t, var.dtype.base_dtype), 136 lr_t = math_ops.cast(self._lr_t, var.dtype.base_dtype [all...] |
external_optimizer_test.py | 27 from tensorflow.python.ops import math_ops 78 loss = math_ops.reduce_sum( 79 math_ops.square(vector - minimum_location[:2])) / 2. 80 loss += math_ops.reduce_sum( 81 math_ops.square(scalar - minimum_location[2])) / 2. 82 loss += math_ops.reduce_sum( 83 math_ops.square( 105 loss = math_ops.reduce_sum(math_ops.square(vector - minimum_location)) / 2. 148 s = math_ops.add [all...] |
/external/tensorflow/tensorflow/python/ops/distributions/ |
dirichlet.py | 27 from tensorflow.python.ops import math_ops 162 self._total_concentration = math_ops.reduce_sum(self._concentration, -1) 201 return gamma_sample / math_ops.reduce_sum(gamma_sample, -1, keepdims=True) 209 return math_ops.exp(self._log_prob(x)) 213 return math_ops.reduce_sum((self.concentration - 1.) * math_ops.log(x), -1) 219 k = math_ops.cast(self.event_shape_tensor()[0], self.dtype) 223 * math_ops.digamma(self.total_concentration)) 224 - math_ops.reduce_sum( 225 (self.concentration - 1.) * math_ops.digamma(self.concentration) [all...] |
student_t.py | 30 from tensorflow.python.ops import math_ops 213 return constant_op.constant([], dtype=math_ops.int32) 234 samples = normal_sample * math_ops.rsqrt(gamma_sample / df) 242 return -0.5 * (self.df + 1.) * math_ops.log1p(y**2. / self.df) 245 return (math_ops.log(math_ops.abs(self.scale)) + 246 0.5 * math_ops.log(self.df) + 248 math_ops.lgamma(0.5 * self.df) - 249 math_ops.lgamma(0.5 * (self.df + 1.))) 252 return math_ops.exp(self._log_prob(x) [all...] |
gamma.py | 30 from tensorflow.python.ops import math_ops 197 return math_ops.exp(self._log_prob(x)) 200 return math_ops.log(self._cdf(x)) 206 return math_ops.igamma(self.concentration, self.rate * x) 210 return (self.concentration - 1.) * math_ops.log(x) - self.rate * x 213 return (math_ops.lgamma(self.concentration) 214 - self.concentration * math_ops.log(self.rate)) 218 - math_ops.log(self.rate) 219 + math_ops.lgamma(self.concentration) 221 math_ops.digamma(self.concentration)) [all...] |
/external/tensorflow/tensorflow/contrib/gan/python/eval/python/ |
classifier_metrics_impl.py | 46 from tensorflow.python.ops import math_ops 104 si = array_ops.where(math_ops.less(s, eps), s, math_ops.sqrt(s)) 108 return math_ops.matmul( 109 math_ops.matmul(u, array_ops.diag(si)), v, transpose_b=True) 135 images = math_ops.to_float(images) 178 return math_ops.reduce_sum( 179 p * (nn_ops.log_softmax(p_logits) - math_ops.log(q)), axis=1) 379 logits = math_ops.to_double(logits) 382 q = math_ops.reduce_mean(p, axis=0 [all...] |
/external/tensorflow/tensorflow/contrib/data/python/ops/ |
resampling.py | 30 from tensorflow.python.ops import math_ops 89 proportion_rejected = math_ops.reduce_sum( 92 math_ops.less(proportion_rejected, .5), 162 max_ratio = math_ops.reduce_max(ratio_l) 181 num_examples_per_class_seen = math_ops.add( 182 num_examples_per_class_seen, math_ops.reduce_sum( 184 init_prob_estimate = math_ops.truediv( 186 math_ops.reduce_sum(num_examples_per_class_seen)) 187 dist = math_ops.cast(init_prob_estimate, dtypes.float32)
|
/external/tensorflow/tensorflow/contrib/distributions/python/ops/bijectors/ |
softplus.py | 24 from tensorflow.python.ops import math_ops 111 hinge_softness = math_ops.cast(self.hinge_softness, x.dtype) 117 hinge_softness = math_ops.cast(self.hinge_softness, y.dtype) 123 # ildj = math_ops.reduce_sum(y - distribution_util.softplus_inverse(y), 132 y /= math_ops.cast(self.hinge_softness, y.dtype) 133 return -math_ops.reduce_sum(math_ops.log(-math_ops.expm1(-y)), 138 x /= math_ops.cast(self.hinge_softness, x.dtype) 139 return -math_ops.reduce_sum(nn_ops.softplus(-x) [all...] |
/external/tensorflow/tensorflow/contrib/layers/python/ops/ |
sparse_ops.py | 25 from tensorflow.python.ops import math_ops 52 return math_ops.cast(ignore_value, dtype, name="ignore_value") 74 math_ops.not_equal(dense_tensor, ignore_value), name="indices") 149 missing_indicators = math_ops.equal( 166 math_ops.cumsum(binary_indicators, axis=-1), "row_index_indicators") 168 math_ops.reduce_max(row_index_indicators), shape=(1,), 182 values=math_ops.cast( 223 num_rows = math_ops.cast(sparse_input.dense_shape[row_axis], dtypes.int32) 224 row_envelope = math_ops.unsorted_segment_max(
|
/external/tensorflow/tensorflow/python/training/ |
momentum.py | 22 from tensorflow.python.ops import math_ops 94 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 96 math_ops.cast(self._momentum_tensor, var.dtype.base_dtype), 104 math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), 106 math_ops.cast(self._momentum_tensor, grad.dtype.base_dtype), 114 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 116 math_ops.cast(self._momentum_tensor, var.dtype.base_dtype), 124 math_ops.cast(self._learning_rate_tensor, grad.dtype), 126 math_ops.cast(self._momentum_tensor, grad.dtype),
|
adagrad_da.py | 23 from tensorflow.python.ops import math_ops 118 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 119 math_ops.cast(self._l1_regularization_strength, var.dtype.base_dtype), 120 math_ops.cast(self._l2_regularization_strength, var.dtype.base_dtype), 134 math_ops.cast(self._learning_rate_tensor, grad.dtype.base_dtype), 135 math_ops.cast(self._l1_regularization_strength, grad.dtype.base_dtype), 136 math_ops.cast(self._l2_regularization_strength, grad.dtype.base_dtype), 151 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 152 math_ops.cast(self._l1_regularization_strength, var.dtype.base_dtype), 153 math_ops.cast(self._l2_regularization_strength, var.dtype.base_dtype) [all...] |
/external/tensorflow/tensorflow/contrib/distributions/python/ops/ |
kumaraswamy.py | 26 from tensorflow.python.ops import math_ops 59 return math_ops.digamma(x + one) - math_ops.digamma(one) 179 return math_ops.log1p(-(1 - x**a)**b) 195 return b * math_ops.log1p(-x**a) 201 return (a - 1) * math_ops.log(x) + (b - 1) * math_ops.log1p(-x**a) 206 return -(math_ops.log(a) + math_ops.log(b)) 212 1 - 1. / b) * _harmonic_number(b) + math_ops.log(a) + math_ops.log(b [all...] |
negative_binomial.py | 26 from tensorflow.python.ops import math_ops 148 beta=math_ops.exp(-self.logits), 160 return math_ops.betainc(self.total_count, 1. + x, 161 math_ops.sigmoid(-self.logits)) 170 return (self.total_count * math_ops.log_sigmoid(-self.logits) 171 + x * math_ops.log_sigmoid(self.logits)) 176 return (-math_ops.lgamma(self.total_count + x) 177 + math_ops.lgamma(1. + x) 178 + math_ops.lgamma(self.total_count)) 181 return self.total_count * math_ops.exp(self.logits [all...] |
/external/tensorflow/tensorflow/python/ops/ |
clip_ops.py | 30 from tensorflow.python.ops import math_ops 64 t_min = math_ops.minimum(t, clip_value_max) 69 t_max = math_ops.maximum(t_min, clip_value_min, name=name) 113 l2norm = math_ops.sqrt(math_ops.reduce_sum(t * t, axes, keepdims=True)) 119 intermediate / math_ops.maximum(l2norm, clip_norm), name=name) 163 half_squared_norm = math_ops.reduce_sum(array_ops.stack(half_squared_norms)) 165 norm = math_ops.sqrt( 227 scale = clip_norm * math_ops.minimum( 287 n_element = math_ops.cast(array_ops.size(t), dtypes.float32 [all...] |
math_ops_test.py | 15 """Tests for tensorflow.ops.math_ops.""" 28 from tensorflow.python.ops import math_ops 45 y_tf = self.evaluate(math_ops.reduce_sum(x)) 53 self.assertAllEqual(self.evaluate(math_ops.reduce_sum(x, axis=axis)), 56 self.assertAllEqual(self.evaluate(math_ops.reduce_sum(x, axis=axis)), 59 self.assertEqual(self.evaluate(math_ops.reduce_sum(x, axis=axis)), 21) 70 math_ops.reduce_sum(x, axis) 80 y_tf_np = math_ops.reduce_logsumexp(x_np).eval() 88 y_tf = math_ops.reduce_logsumexp(x_np, reduction_indices=[0]) 98 y_tf = math_ops.reduce_logsumexp(x_np, reduction_indices=0 [all...] |
/external/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/bijectors/ |
inline_test.py | 27 from tensorflow.python.ops import math_ops 38 forward_fn=math_ops.exp, 39 inverse_fn=math_ops.log, 41 lambda y: -math_ops.reduce_sum( # pylint: disable=g-long-lambda 42 math_ops.log(y), reduction_indices=-1)), 44 lambda x: math_ops.reduce_sum(x, reduction_indices=-1)),
|
/external/tensorflow/tensorflow/contrib/graph_editor/tests/ |
match_test.py | 23 from tensorflow.python.ops import math_ops 35 self.c = math_ops.add(self.a, self.b, name="c") 38 self.e = math_ops.add(self.c, self.d, name="e") 39 self.f = math_ops.add(self.c, self.d, name="f") 40 self.g = math_ops.add(self.c, self.a, name="g") 42 self.h = math_ops.add(self.f, self.g, name="h")
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
logging_ops_test.py | 27 from tensorflow.python.ops import math_ops 43 math_ops.less(epsilon, y), ["Divide-by-zero"]) 45 out = math_ops.div(z, y) 53 math_ops.less(epsilon, x), ["Divide-by-zero", "less than x"]) 55 out = math_ops.div(z, x) 72 wx = math_ops.matmul(w, inp, name="wx")
|
/external/tensorflow/tensorflow/python/ops/linalg/ |
linalg_impl.py | 25 from tensorflow.python.ops import math_ops 52 tensordot = math_ops.tensordot 53 trace = math_ops.trace 86 return 2.0 * math_ops.reduce_sum( 87 math_ops.log(math_ops.real(array_ops.matrix_diag_part(chol))),
|
/external/tensorflow/tensorflow/contrib/py2tf/impl/ |
api_test.py | 25 from tensorflow.python.ops import math_ops 32 config.DEFAULT_UNCOMPILED_MODULES.add((math_ops.__name__,)) 50 while math_ops.reduce_sum(x) > s: 66 return math_ops.negative(a) 70 while math_ops.reduce_sum(x) > s: 87 return math_ops.negative(a) 91 while math_ops.reduce_sum(x) > s: 114 while math_ops.reduce_sum(x) > s: 136 while math_ops.reduce_sum(x) > s: 152 return math_ops.negative(a [all...] |
/external/tensorflow/tensorflow/contrib/quantize/python/ |
quant_ops.py | 26 from tensorflow.python.ops import math_ops 127 batch_min = math_ops.reduce_min( 132 batch_min = math_ops.reduce_min(inputs, name='BatchMin') 134 batch_min = math_ops.minimum(batch_min, 0.0) 140 batch_max = math_ops.reduce_max( 145 batch_max = math_ops.reduce_max(inputs, name='BatchMax') 147 batch_max = math_ops.maximum(batch_max, 0.0) 239 batch_min = math_ops.reduce_min( 244 batch_min = math_ops.reduce_min(inputs, name='BatchMin') 246 batch_min = math_ops.minimum(batch_min, 0.0 [all...] |
/external/tensorflow/tensorflow/contrib/crf/python/ops/ |
crf.py | 60 from tensorflow.python.ops import math_ops 92 math_ops.range(batch_size, dtype=tag_indices.dtype), [-1, 1]) 106 pred=math_ops.equal(inputs.shape[1].value or array_ops.shape(inputs)[1], 131 return math_ops.reduce_logsumexp(first_input, [1]) 146 log_norm = math_ops.reduce_logsumexp(alphas, [1]) 150 return control_flow_ops.cond(pred=math_ops.equal(max_seq_len, 1), 207 math_ops.range(batch_size) * max_seq_len * num_tags, 1) 208 offsets += array_ops.expand_dims(math_ops.range(max_seq_len) * num_tags, 0) 211 offsets = math_ops.to_int64(offsets) 222 unary_scores = math_ops.reduce_sum(unary_scores * masks, 1 [all...] |