3737import org .tensorflow .op .math .Betainc ;
3838import org .tensorflow .op .math .Bincount ;
3939import org .tensorflow .op .math .Ceil ;
40- import org .tensorflow .op .math .CompareAndBitpack ;
4140import org .tensorflow .op .math .ComplexAbs ;
4241import org .tensorflow .op .math .Conj ;
4342import org .tensorflow .op .math .Cos ;
@@ -481,11 +480,22 @@ public <T extends TType> Atan<T> atan(Operand<T> x) {
481480
482481 /**
483482 * Computes arctangent of {@code y/x} element-wise, respecting signs of the arguments.
484- * This is the angle ( \theta \in [-\pi, \pi] ) such that
485- * [ x = r \cos(\theta) ]
483+ * This is the angle \ ( \theta \in [-\pi, \pi] \ ) such that
484+ * \ [ x = r \cos(\theta) \ ]
486485 * and
487- * [ y = r \sin(\theta) ]
488- * where (r = \sqrt(x^2 + y^2) ).
486+ * \[ y = r \sin(\theta) \]
487+ * where \(r = \sqrt{x^2 + y^2} \).
488+ * <p>For example:
489+ * <blockquote>
490+ * <blockquote>
491+ * <blockquote>
492+ * <p>x = [1., 1.]
493+ * y = [1., -1.]
494+ * print((tf.math.atan2(y,x) * (180 / np.pi)).numpy())
495+ * [ 45. -45.]
496+ * </blockquote>
497+ * </blockquote>
498+ * </blockquote>
489499 *
490500 * @param <T> data type for {@code z} output
491501 * @param y the y value
@@ -573,44 +583,22 @@ public <T extends TNumber> Ceil<T> ceil(Operand<T> x) {
573583 return Ceil .create (scope , x );
574584 }
575585
576- /**
577- * Compare values of {@code input} to {@code threshold} and pack resulting bits into a {@code uint8}.
578- * Each comparison returns a boolean {@code true} (if {@code input_value > threshold})
579- * or and {@code false} otherwise.
580- * <p>This operation is useful for Locality-Sensitive-Hashing (LSH) and other
581- * algorithms that use hashing approximations of cosine and {@code L2} distances;
582- * codes can be generated from an input via:
583- * <pre>
584- * codebook_size = 50
585- * codebook_bits = codebook_size * 32
586- * codebook = tf.get_variable('codebook', [x.shape[-1].value, codebook_bits],
587- * dtype=x.dtype,
588- * initializer=tf.orthogonal_initializer())
589- * codes = compare_and_threshold(tf.matmul(x, codebook), threshold=0.)
590- * codes = tf.bitcast(codes, tf.int32) # go from uint8 to int32
591- * # now codes has shape x.shape[:-1] + [codebook_size]
592- * </pre>
593- * <p><strong>NOTE</strong>: Currently, the innermost dimension of the tensor must be divisible
594- * by 8.
595- * <p>Given an {@code input} shaped {@code [s0, s1, ..., s_n]}, the output is
596- * a {@code uint8} tensor shaped {@code [s0, s1, ..., s_n / 8]}.
597- *
598- * @param input Values to compare against {@code threshold} and bitpack.
599- * @param threshold Threshold to compare against.
600- * @param <T> data type for {@code CompareAndBitpack} output and operands
601- * @return a new instance of CompareAndBitpack
602- */
603- public <T extends TType > CompareAndBitpack compareAndBitpack (Operand <T > input ,
604- Operand <T > threshold ) {
605- return CompareAndBitpack .create (scope , input , threshold );
606- }
607-
608586 /**
609587 * Computes the complex absolute value of a tensor.
610588 * Given a tensor {@code x} of complex numbers, this operation returns a tensor of type
611589 * {@code float} or {@code double} that is the absolute value of each element in {@code x}. All
612590 * elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute
613591 * value is computed as \( \sqrt{a^2 + b^2}\).
592+ * <p>For example:
593+ * <blockquote>
594+ * <blockquote>
595+ * <blockquote>
596+ * <p>x = tf.complex(3.0, 4.0)
597+ * print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy())
598+ * 5.0
599+ * </blockquote>
600+ * </blockquote>
601+ * </blockquote>
614602 *
615603 * @param <U> data type for {@code y} output
616604 * @param x the x value
@@ -626,6 +614,16 @@ public ComplexAbs<TFloat32> complexAbs(Operand<? extends TType> x) {
626614 * {@code float} or {@code double} that is the absolute value of each element in {@code x}. All
627615 * elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute
628616 * value is computed as \( \sqrt{a^2 + b^2}\).
617+ * <p>For example:
618+ * <blockquote>
619+ * <blockquote>
620+ * <blockquote>
621+ * <p>x = tf.complex(3.0, 4.0)
622+ * print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy())
623+ * 5.0
624+ * </blockquote>
625+ * </blockquote>
626+ * </blockquote>
629627 *
630628 * @param <U> data type for {@code y} output
631629 * @param x the x value
@@ -867,7 +865,7 @@ public <T extends TType> Equal equal(Operand<T> x, Operand<T> y, Equal.Options..
867865 }
868866
869867 /**
870- * Computes the Gauss error function of {@code x} element-wise.
868+ * Computes the <a href="https://en.wikipedia.org/wiki/Error_function"> Gauss error function</a> of {@code x} element-wise. In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$ .
871869 *
872870 * @param <T> data type for {@code y} output
873871 * @param x the x value
@@ -1085,8 +1083,8 @@ public <T extends TNumber> Igamma<T> igamma(Operand<T> a, Operand<T> x) {
10851083 * The upper regularized incomplete Gamma function is defined as:
10861084 * <p>\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\)
10871085 * <p>where
1088- * <p>\(Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt\)
1089- * <p>is the upper incomplete Gama function.
1086+ * <p>\(Gamma(a, x) = \ int_{x}^{\infty} t^{a-1} exp(-t) dt\)
1087+ * <p>is the upper incomplete Gamma function.
10901088 * <p>Note, above {@code P(a, x)} ({@code Igamma}) is the lower regularized complete
10911089 * Gamma function.
10921090 *
@@ -2234,9 +2232,9 @@ public <T extends TType> UnsortedSegmentProd<T> unsortedSegmentProd(Operand<T> d
22342232 * </div>
22352233 * <pre>
22362234 * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
2237- * tf.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
2238- * # ==> [[ 5, 5, 5, 5],
2239- * # [5, 6, 7, 8]]
2235+ * tf.math. unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
2236+ * # ==> [[ 5, 5, 5, 5],
2237+ * # [5, 6, 7, 8]]
22402238 * </pre>
22412239 *
22422240 * @param <T> data type for {@code output} output
0 commit comments