当前位置:网站首页>MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
2022-07-06 21:01:00 【wx5d786476cd8b2】
MLP( Multilayer perceptron neural network ) That is, multi-layer fully connected neural network model .
from keras.datasets import mnist
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense,Dropout,Activation
batch_size=128
nb_classes=10
nb_epoch=10
img_size=28*28
(x_train,y_train),(x_test,y_test)=mnist.load_data("E:\Code\PycharmProjects\KerasStudying\data\mnist.npz")
x_train=x_train.reshape(-1,img_size).astype('float32')/255
x_test=x_test.reshape(-1,img_size).astype('float32')/255
y_train=np_utils.to_categorical(y_train,nb_classes)
y_test=np_utils.to_categorical(y_test,nb_classes)
model=Sequential([
Dense(512,input_shape=(img_size,),activation='relu',),
Dropout(0.2),
Dense(512,input_shape=(512,),activation='relu'),
Dropout(0.2),
Dense(10,input_shape=(512,),activation='softmax'),
])
model.summary()
model.compile(optimizer='rmsprop',loss='categorical_crossentropy',metrics=['accuracy'])
model.fit(x_train,y_train,batch_size=batch_size,epochs=10,verbose=0,validation_data=(x_test,y_test))
score=model.evaluate(x_test,y_test,verbose=0)
print('accuracy:'+str(score[1]))
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
边栏推荐
- 15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
- 正则表达式收集
- PHP saves session data to MySQL database
- 【mysql】触发器
- 基于深度学习的参考帧生成
- C language games - three chess
- Minimum cut edge set of undirected graph
- Summary of different configurations of PHP Xdebug 3 and xdebug2
- [diy] self designed Microsoft makecode arcade, official open source software and hardware
- 强化学习-学习笔记5 | AlphaGo
猜你喜欢
【微信小程序】運行機制和更新機制
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
Redis insert data garbled solution
Distributed ID
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
Data Lake (VIII): Iceberg data storage format
Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
Common doubts about the introduction of APS by enterprises
随机推荐
C # use Oracle stored procedure to obtain result set instance
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
No Yum source to install SPuG monitoring
Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
Use of OLED screen
请问sql group by 语句问题
每个程序员必须掌握的常用英语词汇(建议收藏)
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
2022 portal crane driver registration examination and portal crane driver examination materials
OAI 5g nr+usrp b210 installation and construction
OSPF multi zone configuration
The mail command is used in combination with the pipeline command statement
[weekly pit] information encryption + [answer] positive integer factorization prime factor
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
Entity alignment two of knowledge map
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
2017 8th Blue Bridge Cup group a provincial tournament
使用.Net分析.Net达人挑战赛参与情况
User defined current limiting annotation