It seems tf.argmax()
and tf.arg_max()
are doing the same thing for outputting the indies of the biggest element in matrix.
https://www.tensorflow.org/api_docs/python/tf/argmax https://www.tensorflow.org/api_docs/python/tf/arg_max
Why does TensorFlow have two APIs for this?
The following is the source code of argmax
(from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/math_ops.py).
# pylint: disable=redefined-builtin
# TODO(aselle): deprecate arg_max
def argmax(input, axis=None, name=None, dimension=None):
if dimension is not None:
if axis is not None:
raise ValueError("Cannot specify both 'axis' and 'dimension'")
axis = dimension
elif axis is None:
axis = 0
return gen_math_ops.arg_max(input, axis, name)
As you can see, argmax
is using arg_max
inside. Also from the code, I recommend using argmax
because arg_max
could be deprecated soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With