tf.argmax () function

Function Description:

tf.argmax( input, axis=None, name=None, dimension=None, output_type=tf.int64)

parameter:

input: Input Matrix
axis: Default is None
name: Default is None
Dimension: Default is None
output_type: the default type int64

Purpose: returns the maximum value of the index is located (the first parameter is a matrix, the second argument is 0 or 1.0 represents the maximum value of the comparison index columns returned by line 1 represents the comparison returns the maximum of index).

Code Example:

tensorflow TF AS Import
the Vector = [1,1,2,5,3] # define a vector
X = [[1,3,2], [ 2,5,8], [7,5,9]] # define a matrix
with tf.Session () AS Sess:
a = tf.argmax (the Vector, 0)
B = tf.argmax (X-, 0)
C = tf.argmax (X-,. 1)
Print (sess.run (a))
Print (sess.run (B))
Print (sess.run (C))

operation result:

3
[2 1 2]
[1 2 2]
————————————————

Original link: https://blog.csdn.net/kdongyi/article/details/82390394

Guess you like

Origin www.cnblogs.com/smartwang/p/11789985.html