/external/tensorflow/tensorflow/contrib/opt/python/training/ |
H A D | sign_decay.py | 28 from tensorflow.python.ops import math_ops namespace 53 global_step = math_ops.minimum(global_step, decay_steps) 54 remaining_steps = math_ops.to_int32(decay_steps) - math_ops.to_int32( 56 decayed = math_ops.to_float(remaining_steps) / math_ops.to_float( 58 return math_ops.maximum(0.0, decayed) 94 global_step = math_ops.minimum(global_step, decay_steps) 95 completed_fraction = math_ops.to_float(global_step) / math_ops [all...] |
H A D | nadam_optimizer.py | 22 from tensorflow.python.ops import math_ops namespace 42 math_ops.cast(beta1_power, var.dtype.base_dtype), 43 math_ops.cast(beta2_power, var.dtype.base_dtype), 44 math_ops.cast(self._lr_t, var.dtype.base_dtype), 45 math_ops.cast(self._beta1_t, var.dtype.base_dtype), 46 math_ops.cast(self._beta2_t, var.dtype.base_dtype), 47 math_ops.cast(self._epsilon_t, var.dtype.base_dtype), 60 math_ops.cast(beta1_power, grad.dtype.base_dtype), 61 math_ops.cast(beta2_power, grad.dtype.base_dtype), 62 math_ops [all...] |
/external/tensorflow/tensorflow/contrib/sparsemax/python/ops/ |
H A D | sparsemax.py | 24 from tensorflow.python.ops import math_ops namespace 52 z = logits - math_ops.reduce_mean(logits, axis=1)[:, array_ops.newaxis] 58 z_cumsum = math_ops.cumsum(z_sorted, axis=1) 59 k = math_ops.range( 60 1, math_ops.cast(dims, logits.dtype) + 1, dtype=logits.dtype) 64 k_z = math_ops.reduce_sum(math_ops.cast(z_check, dtypes.int32), axis=1) 67 indices = array_ops.stack([math_ops.range(0, obs), k_z - 1], axis=1) 69 tau_z = (tau_sum - 1) / math_ops.cast(k_z, logits.dtype) 72 return math_ops [all...] |
H A D | sparsemax_loss.py | 23 from tensorflow.python.ops import math_ops namespace 51 math_ops.reduce_mean(logits, axis=1)[:, array_ops.newaxis] 54 support = math_ops.cast(sparsemax > 0, sparsemax.dtype) 60 return math_ops.reduce_sum(sum_s + q_part, axis=1)
|
/external/tensorflow/tensorflow/python/training/ |
H A D | learning_rate_decay.py | 26 from tensorflow.python.ops import math_ops namespace 98 global_step = math_ops.cast(global_step, dtype) 99 decay_steps = math_ops.cast(decay_steps, dtype) 100 decay_rate = math_ops.cast(decay_rate, dtype) 103 p = math_ops.floor(p) 104 return math_ops.multiply( 105 learning_rate, math_ops.pow(decay_rate, p), name=name) 161 b = math_ops.cast(b, x.dtype.base_dtype) 275 global_step = math_ops.cast(global_step, dtype) 276 decay_steps = math_ops [all...] |
H A D | ftrl.py | 22 from tensorflow.python.ops import math_ops namespace 152 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 153 math_ops.cast(self._l1_regularization_strength_tensor, 155 math_ops.cast(self._l2_regularization_strength_tensor, 157 math_ops.cast(self._learning_rate_power_tensor, var.dtype.base_dtype), 165 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 166 math_ops.cast(self._l1_regularization_strength_tensor, 168 math_ops.cast(self._l2_regularization_strength_tensor, 170 math_ops.cast(self._l2_shrinkage_regularization_strength_tensor, 172 math_ops [all...] |
H A D | rmsprop.py | 47 from tensorflow.python.ops import math_ops namespace 140 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 141 math_ops.cast(self._decay_tensor, var.dtype.base_dtype), 142 math_ops.cast(self._momentum_tensor, var.dtype.base_dtype), 143 math_ops.cast(self._epsilon_tensor, var.dtype.base_dtype), 151 math_ops.cast(self._learning_rate_tensor, var.dtype.base_dtype), 152 math_ops.cast(self._decay_tensor, var.dtype.base_dtype), 153 math_ops.cast(self._momentum_tensor, var.dtype.base_dtype), 154 math_ops.cast(self._epsilon_tensor, var.dtype.base_dtype), 168 math_ops [all...] |
/external/tensorflow/tensorflow/contrib/distributions/python/ops/bijectors/ |
H A D | sinh_arcsinh.py | 27 from tensorflow.python.ops import math_ops namespace 38 math_ops.abs(x) * np.sqrt(np.finfo(x.dtype.as_numpy_dtype).eps) <= 1., 39 math_ops.sqrt(x**2. + 1.), 55 math_ops.abs(x)) 141 return math_ops.sinh((math_ops.asinh(x) + self.skewness) * self.tailweight) 144 return math_ops.sinh(math_ops.asinh(y) / self.tailweight - self.skewness) 153 return math_ops.reduce_sum( 156 math_ops [all...] |
H A D | sigmoid.py | 21 from tensorflow.python.ops import math_ops namespace 39 return math_ops.sigmoid(x) 42 return math_ops.log(y) - math_ops.log1p(-y) 45 return -math_ops.log(y) - math_ops.log1p(-y)
|
H A D | power_transform.py | 25 from tensorflow.python.ops import math_ops namespace 85 return math_ops.exp(x) 88 return math_ops.exp(math_ops.log1p(x * self.power) / self.power) 93 return math_ops.log(y) 96 return math_ops.expm1(math_ops.log(y) * self.power) / self.power 101 return (self.power - 1.) * math_ops.reduce_sum( 102 math_ops.log(y), axis=event_dims) 108 return math_ops [all...] |
H A D | gumbel.py | 25 from tensorflow.python.ops import math_ops namespace 97 return math_ops.exp(-math_ops.exp(-z)) 101 return self.loc - self.scale * math_ops.log(-math_ops.log(y)) 106 return math_ops.reduce_sum( 107 math_ops.log(self.scale / (-math_ops.log(y) * y)), axis=event_dims) 112 return math_ops.reduce_sum( 113 -z - math_ops [all...] |
/external/tensorflow/tensorflow/contrib/distributions/python/ops/ |
H A D | normal_conjugate_posteriors.py | 21 from tensorflow.python.ops import math_ops namespace 75 n = math_ops.cast(n, prior.dtype) 76 scale0_2 = math_ops.square(prior.scale) 77 scale_2 = math_ops.square(scale) 81 scale=math_ops.sqrt(scalep_2)) 141 n = math_ops.cast(n, prior.dtype) 142 scale0_2 = math_ops.square(prior.scale) 143 scale_2 = math_ops.square(scale) 147 scale=math_ops.sqrt(scalep_2 + scale_2))
|
/external/tensorflow/tensorflow/contrib/metrics/python/metrics/ |
H A D | classification.py | 24 from tensorflow.python.ops import math_ops namespace 57 is_correct = math_ops.cast( 58 math_ops.equal(predictions, labels), dtypes.float32) 60 is_correct = math_ops.multiply(is_correct, weights) 61 num_values = math_ops.multiply(weights, array_ops.ones_like(is_correct)) 62 return math_ops.div(math_ops.reduce_sum(is_correct), 63 math_ops.reduce_sum(num_values)) 64 return math_ops.reduce_mean(is_correct)
|
/external/tensorflow/tensorflow/contrib/losses/python/losses/ |
H A D | loss_ops.py | 27 from tensorflow.python.ops import math_ops namespace 62 reduced_losses = math_ops.reduce_sum( 64 reduced_losses = math_ops.multiply(reduced_losses, weights) 65 return math_ops.reduce_sum(reduced_losses) 85 math_ops.greater(denominator, 0), 86 math_ops.div(numerator, 88 math_ops.equal(denominator, 0), 105 total_loss = math_ops.reduce_sum(losses) 129 losses = math_ops.to_float(losses) 130 weights = math_ops [all...] |
/external/tensorflow/tensorflow/contrib/layers/python/ops/ |
H A D | bucketization_op.py | 20 from tensorflow.python.ops import math_ops namespace 40 return math_ops._bucketize( # pylint: disable=protected-access
|
/external/tensorflow/tensorflow/contrib/losses/python/metric_learning/ |
H A D | metric_loss_ops.py | 27 from tensorflow.python.ops import math_ops namespace 52 pairwise_distances_squared = math_ops.add( 53 math_ops.reduce_sum( 54 math_ops.square(feature), 57 math_ops.reduce_sum( 58 math_ops.square( 61 keepdims=True)) - 2.0 * math_ops.matmul( 65 pairwise_distances_squared = math_ops.maximum(pairwise_distances_squared, 0.0) 67 error_mask = math_ops.less_equal(pairwise_distances_squared, 0.0) 73 pairwise_distances = math_ops [all...] |
/external/tensorflow/tensorflow/python/kernel_tests/ |
H A D | bincount_op_test.py | 15 """Tests for math_ops.bincount.""" 25 from tensorflow.python.ops import math_ops namespace 34 math_ops.bincount([], minlength=5).eval(), [0, 0, 0, 0, 0]) 35 self.assertAllEqual(math_ops.bincount([], minlength=1).eval(), [0]) 36 self.assertAllEqual(math_ops.bincount([], minlength=0).eval(), []) 38 math_ops.bincount([], minlength=0, dtype=np.float32).eval().dtype, 41 math_ops.bincount([], minlength=3, dtype=np.float64).eval().dtype, 47 math_ops.bincount([1, 1, 1, 2, 2, 3]).eval(), [0, 3, 2, 1]) 49 self.assertAllEqual(math_ops.bincount(arr).eval(), [0, 5, 4, 3, 2, 1]) 51 self.assertAllEqual(math_ops [all...] |
/external/tensorflow/tensorflow/python/ops/ |
H A D | spectral_grad.py | 25 from tensorflow.python.ops import math_ops namespace 30 return math_ops.reduce_prod(array_ops.shape(grad)[-rank:]) 35 size = math_ops.cast(_FFTSizeForGrad(grad, 1), dtypes.float32) 36 return spectral_ops.ifft(grad) * math_ops.complex(size, 0.) 41 rsize = 1. / math_ops.cast(_FFTSizeForGrad(grad, 1), dtypes.float32) 42 return spectral_ops.fft(grad) * math_ops.complex(rsize, 0.) 47 size = math_ops.cast(_FFTSizeForGrad(grad, 2), dtypes.float32) 48 return spectral_ops.ifft2d(grad) * math_ops.complex(size, 0.) 53 rsize = 1. / math_ops.cast(_FFTSizeForGrad(grad, 2), dtypes.float32) 54 return spectral_ops.fft2d(grad) * math_ops [all...] |
H A D | math_grad.py | 15 """Gradients for operators defined in math_ops.py.""" 30 from tensorflow.python.ops import math_ops namespace 35 return x // math_ops.maximum(y, 1) 61 output_shape_kept_dims = math_ops.reduced_shape(input_shape, op.inputs[1]) 70 output_shape_kept_dims = math_ops.reduced_shape(input_shape, op.inputs[1]) 78 indicators = math_ops.cast(math_ops.equal(y, op.inputs[0]), grad.dtype) 80 math_ops.reduce_sum(indicators, op.inputs[1]), output_shape_kept_dims) 82 return [math_ops.div(indicators, num_selected) * grad, None] 112 math_ops [all...] |
H A D | linalg_grad.py | 34 from tensorflow.python.ops import math_ops namespace 42 return -math_ops.matmul( 43 ainv, math_ops.matmul(grad, ainv, adjoint_b=True), adjoint_a=True) 72 middle = math_ops.matmul(l, grad, adjoint_a=True) 77 grad_a = math_ops.matmul( 78 math_ops.matmul(l_inverse, middle, adjoint_a=True), l_inverse) 97 qdq = math_ops.matmul(q, dq, adjoint_a=True) 99 rdr = math_ops.matmul(r, dr, adjoint_b=True) 109 grad_a = math_ops.matmul(q, dr + _TriangularSolve(tril, r)) 110 grad_b = _TriangularSolve(dq - math_ops [all...] |
H A D | metrics_impl.py | 29 from tensorflow.python.ops import math_ops namespace 106 math_ops.equal(rank_diff, -1), 118 math_ops.equal(rank_diff, 1), maybe_squeeze_weights, 124 math_ops.equal(weights_rank_tensor, 0), lambda: weights, 151 math_ops.equal( 175 math_ops.equal(array_ops.rank(predictions), 191 t = math_ops.truediv(numerator, denominator) 193 condition = math_ops.greater(denominator, zero) 194 zero = math_ops.cast(zero, t.dtype) 212 math_ops [all...] |
/external/tensorflow/tensorflow/contrib/timeseries/python/timeseries/state_space_models/ |
H A D | kalman_filter.py | 30 from tensorflow.python.ops import math_ops namespace 131 min_diag = math_ops.reduce_min(diag) 170 math_ops.matmul( 207 prior_variance_transitioned = math_ops.matmul( 208 math_ops.matmul(transition_matrices, prior_state_var), 243 kalman_solve_rhs = math_ops.matmul( 253 math_ops.matmul( 258 gain_obs = math_ops.matmul( 266 posterior_state_var = math_ops.matmul(identity_minus_factor, 280 left_multiplied_state_var = math_ops [all...] |
/external/tensorflow/tensorflow/contrib/bayesflow/python/ops/ |
H A D | halton_sequence_impl.py | 29 from tensorflow.python.ops import math_ops namespace 157 max_sizes_by_axes = _base_expansion_size(math_ops.reduce_max(indices), 160 max_size = math_ops.reduce_max(max_sizes_by_axes) 172 exponents_by_axes = array_ops.tile([math_ops.range(max_size)], [dim, 1]) 177 coeffs = math_ops.floor_div(indices, weights) 178 coeffs *= 1 - math_ops.cast(weight_mask, dtype) 180 return math_ops.reduce_sum(coeffs / weights, axis=-1) 209 sample_indices = math_ops.range(n, dtype=dtype) 211 sample_indices = math_ops.cast(sample_indices, dtype) 241 return math_ops [all...] |
/external/tensorflow/tensorflow/contrib/boosted_trees/python/utils/ |
H A D | losses.py | 24 from tensorflow.python.ops import math_ops namespace 40 labels = math_ops.to_float(labels) 68 labels = math_ops.to_int64(labels) 75 labels = math_ops.reduce_sum( 77 labels = math_ops.to_float(labels) 80 unnormalized_probs = math_ops.exp(logits) 81 normalizers = math_ops.reduce_sum(unnormalized_probs, 1, keepdims=True) 82 softmax_predictions = math_ops.divide(unnormalized_probs, 83 math_ops.add(normalizers, eps)) 86 probs_for_real_class = math_ops [all...] |
/external/tensorflow/tensorflow/contrib/kfac/python/kernel_tests/ |
H A D | op_queue_test.py | 23 from tensorflow.python.ops import math_ops namespace 33 math_ops.add(1, 2), 34 math_ops.subtract(1, 2), 35 math_ops.reduce_mean([1, 2]),
|