注意:此代码全部为TensorFlow1版本。...占位符使用
# 占位符示例
import tensorflow as tf
# 不确定数据,先使用占位符占个位置
plhd = tf.placeholder(tf.float32, [2, 3])...,与data具有相同的形状
# 但大小为 k(段的数目)的维度0除外
data = tf.constant([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=tf.float32...(tf.float32, [None, 784]) # 占位符,输入
y = tf.placeholder(tf.float32, [None, 10]) # 占位符,输出
W = tf.Variable...tf.argmax(self.y_, 1))#取出真实概率中最大的值的索引
# 将上一步得到的bool类型数组转换为浮点型