import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import input_data
mnist = input_data.read_data_sets('data/', one_hot=True)#帮助下载数据集并且分为训练集测试集等
trainimg = mnist.train.images
trainlabel = mnist.train.labels
testimg = mnist.test.images
testlabel = mnist.test.labels
print ("MNIST loaded")
print (trainimg.shape)
print (trainlabel.shape)
print (testimg.shape)
print (testlabel.shape)
#print (trainimg)
print (trainlabel[0])
(55000, 784)#训练数据集数量和大小
(55000, 10)#训练数据集和标签
(10000, 784)#测试数据集数量和大小
(10000, 10)#测试数据集和标签
[0. 0. 0. 0. 0. 0. 0. 1. 0. 0.]#分类方式是属于就是1不属于就是0
初始化所有的参数y=w*x+b
x = tf.placeholder("float", [None, 784]) #placeholder先占据一个位置,不给付实际的值制定矩阵第一个是样本数目,第二个是像素个数
y