1.keras介绍
keras是基于Tensorflow、Theano、CNTK后端的高层神经网络API,它简单快速的原型设计,让你可以快速的将idea转化为结果,并且可以在CPU和GPU之间无缝切换。
2. keras模块思维导图
3.快速上手-mnist手写字识别
#-*-coding:utf-8-*-
from keras.models import Sequential
from keras.datasets import mnist
from keras.optimizers import Adam
from keras.losses import categorical_crossentropy
from keras.layers import Dense,Reshape,Dropout,Flatten,Conv2D,MaxPool2D
from keras.utils import to_categorical
def loadData():
(x_train,y_train),(x_test,y_test) = mnist.load_data()
return x_train,y_train,x_test,y_test
def shuffle():
pass
def createModel():
model = Sequential()
#reshape image to tensorf