首页 > 分享 > matlab——简单CNN网络的数字识别

matlab——简单CNN网络的数字识别

最新推荐文章于 2024-11-07 15:18:16 发布

xjc0518 于 2019-09-09 10:14:00 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

digitDatasetPath = fullfile(matlabroot,'toolbox','nnet', ... 'nndemos','nndatasets','DigitDataset'); imds = imageDatastore(digitDatasetPath, ... 'IncludeSubfolders',true, ... 'LabelSource','foldernames'); 12345

figure numImages = 10000; perm = randperm(numImages,20); for i = 1:20 subplot(4,5,i); imshow(imds.Files{perm(i)}); end 1234567

layers = [ ... imageInputLayer([28 28 1]) convolution2dLayer(5,20) reluLayer maxPooling2dLayer(2,'Stride',2) fullyConnectedLayer(10) softmaxLayer classificationLayer]; 12345678

options = trainingOptions('sgdm', ... 'MaxEpochs',20,... 'InitialLearnRate',1e-4, ... 'Verbose',false, ... 'Plots','training-progress'); 12345

net = trainNetwork(imdsTrain,layers,options); 1

YPred = classify(net,imdsTest); YTest = imdsTest.Labels; 12

accuracy = sum(YPred == YTest)/numel(YTest) 1

相关知识

使用matlab,利用CNN算法实现对蒲公英、玫瑰花、百合花、牵牛花的识别
pytorch实现简单卷积神经网络(CNN)网络完成手写数字识别
基于Matlab花卉识别分类系统
【深度学习】详解CNN实现手写数字识别(keras)
MATLAB实现低配电脑的果树病虫害深度学习识别
【疾病识别】SVM农作物叶子虫害识别与分类【含GUI Matlab源码 1322期】
手写数字识别原理:从感知到认知
深度学习之基于Matlab GoogleNet网络的花朵分类识别
【疾病分类】SVM农作物叶子虫害识别与分类【含Matlab源码 624期】
【深度学习系列】手写数字识别

网址: matlab——简单CNN网络的数字识别 https://m.huajiangbk.com/newsview1101472.html

所属分类:花卉
上一篇: C++循环结构设计——水仙花数
下一篇: 153 = 1*1*1 + 5*