对matplotlib的解释
import matplotlib.pyplot as plt
import numpy as np
a = [[1,2]]
a = np.array(a)
c = a[:,0]#‘:'表示:不管a中有几组数据,打印所有组数据的下标为0的数据 c=1
b = a[:,1] #b=2
print(c,b)#[1] [2]
print(a.shape)#(1,2),表示一行两列
#画散点图
plt.scatter(c,b)#画一个点,点的坐标是(1,2)
plt.show()
keras 非监督Autoencoding学习 非序列化Sequential
#分类
import numpy as np
from keras.datasets import mnist
from keras.models import Model
from keras.layers import Dense,Input
import matplotlib.pyplot as plt
from PIL import Image
#加载数据集 mnist
(X_train,Y_train),(X_test,Y_test) = mnist.load_data()
#数据处理
#转浮点、归一化
#不需要处理标签
#因为是图和图之间相比
X_train = X_train.astype(‘float32’)/255.0 #set as type to