[关闭]
@ZSCDumin 2019-02-19T09:41:22.000000Z 字数 659 阅读 472

Tensorflow 学习笔记

tensorflow


1. 设置tensorflow输出日志级别

  1. import os
  2. os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

2. tf.argmax()函数

  1. A = [[1, 3, 4, 5, 6]]
  2. B = [[1, 3, 4], [2, 4, 1]]
  3. # tf.argmax(y_, 1) 取的是行的最大值对应的下标的索引
  4. # tf.argmax(y_, 0) 取的是列的最大值对应的下标的索引
  5. with tf.Session() as sess:
  6. print(sess.run(tf.argmax(A, 1)))
  7. print(sess.run(tf.argmax(B, 0)))

运行结果:

  1. [4]
  2. [1 1 0]

3. tf.reduce_mean() 函数

  1. reduce_mean(input_tensor,
  2. axis=None,
  3. keep_dims=False,
  4. name=None,
  5. reduction_indices=None)

4.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注