# MNSIT 训练样本有55000个、验证样本5000个、测试样本10000
# Tensorflow 1.2 版本是在这个路径
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
# 数据集:将标签转换成ont-hot 编码的形式
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print(mnist.train.images.shape, mnist.train.labels.shape)
print(mnist.test.images.shape, mnist.test.labels.shape)
print(mnist.validation.images.shape, mnist.validation.labels.shape)
# 定义前向传播:将图片丢弃图片的二维信息,将二维信息转变成1维信息,顺序不重要,只要每张图片都是用同样的规则进行转换即可
# None表示输入Batch_size任意
x = tf.placeholder(tf.float32, [None, 784])
w = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
# 输入矩阵是[Batch_size * 784]*[784*