当前位置: 首页 > news >正文

中国石油建设工程协会网站化妆品网络营销策划方案

中国石油建设工程协会网站,化妆品网络营销策划方案,wordpress 上传mp4,wordpress多媒体分类DenseNet#xff0c;全称为Densely Connected Convolutional Networks#xff0c;中文名为密集连接卷积网络#xff0c;是由李沐等人在2017年提出的一种深度神经网络架构。 DenseNet旨在解决深度神经网络中的梯度消失问题和参数数量过多的问题#xff0c;通过构建密集连接…DenseNet全称为Densely Connected Convolutional Networks中文名为密集连接卷积网络是由李沐等人在2017年提出的一种深度神经网络架构。  DenseNet旨在解决深度神经网络中的梯度消失问题和参数数量过多的问题通过构建密集连接的方式使得网络能够更好地利用之前的特征从而获得更好的性能。DenseNet的核心思想是把网络中前面的层与后面的层进行连接让前面的层的输出成为后面的层的输入。这样整个卷积网络就变得非常紧凑同时也避免了梯度消失的问题。 DenseNet的优点在于参数少、计算速度快、准确率高。因此DenseNet在图像识别、目标检测、图像分割等任务中都取得了很好的表现。 DenseNet是一种深度神经网络架构它具有特殊的连接方式可以有效地减少网络中的参数量提高模型的准确性和稳定性。在图像分类任务中DenseNet常常被使用。 在MATLAB中可以使用深度学习工具箱来搭建和训练DenseNet模型。下面是一个简单的例子展示如何使用深度学习工具箱来训练一个DenseNet模型进行CIFAR-10图像分类。 1. 准备数据 首先需要下载CIFAR-10数据集可以使用MATLAB自带的数据集下载工具来获取数据集。 MATLAB cifar10Data fullfile(tempdir, cifar-10-matlab); if ~exist(cifar10Data, dir)     cifar10Data fullfile(toolboxdir(vision), visiondata, cifar10);     if ~exist(cifar10Data, dir)         mkdir(cifar10Data);         url https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz;         helperCIFAR10Data.download(url, cifar10Data);     end end 2. 加载数据 使用 imageDatastore 函数将数据加载到MATLAB中。在此过程中可以对图像进行增强处理以提高模型的训练效果。 MATLAB % Load training and test data [trainingImages, trainingLabels, testImages, testLabels] helperCIFAR10Data.load(cifar10Data); % Construct an imageDatastore object trainingSet imageDatastore(trainingImages, ...     labels, trainingLabels, ...     ReadFcn, helperCIFAR10Data.readFunction); testSet imageDatastore(testImages, ...     labels, testLabels, ...     ReadFcn, helperCIFAR10Data.readFunction); % Prepare the data for training inputSize [32 32 3]; numClasses 10; % Apply data augmentation augmentedTrainingSet augmentedImageDatastore(inputSize, ...     trainingSet, ...     ColorPreprocessing, gray2rgb, ...     RandCropSize, [28 28], ...     RandCropType, random, ...     RandRotation, [-8 8], ...     RandXReflection, true); 3. 构建DenseNet模型 使用 densenet201 函数从深度学习工具箱中加载DenseNet-201模型。 MATLAB net densenet201; 可以使用 analyzeNetwork 函数来可视化模型架构。 MATLAB analyzeNetwork(net); 4. 训练模型 使用 trainingOptions 函数来配置训练选项。 MATLAB options trainingOptions(sgdm, ...     InitialLearnRate, 0.001, ...     MaxEpochs, 50, ...     MiniBatchSize, 128, ...     VerboseFrequency, 50, ...     Plots, training-progress); 使用 trainNetwork 函数来训练模型。 MATLAB trainedNet trainNetwork(augmentedTrainingSet, net, options); 5. 测试模型 使用 classify 函数来进行分类。 MATLAB predictedLabels classify(trainedNet, testSet); accuracy mean(predictedLabels testSet.Labels) 6. 可视化结果 使用 montage 函数来可视化测试集中的前20张图像及其分类结果。 MATLAB numImages 20; idx randsample(numel(testSet.Files), numImages); figure montage(testSet.Files(idx), Size, [4 5]); title(Test Images); predictedLabels classify(trainedNet, testSet); label cellstr(predictedLabels); label strcat(label, , , cellstr(num2str(testSet.Labels))); groundTruth cellstr(label); groundTruth strcat(Ground Truth: , groundTruth); predicted cellstr(predictedLabels); predicted strcat(Prediction: , predicted); for i 1:numImages     text(i*32-25,3210,groundTruth(idx(i)),FontSize,8)     text(i*32-25,3220,predicted(idx(i)),FontSize,8) end 完整代码如下 MATLAB cifar10Data fullfile(tempdir, cifar-10-matlab); if ~exist(cifar10Data, dir)     cifar10Data fullfile(toolboxdir(vision), visiondata, cifar10);     if ~exist(cifar10Data, dir)         mkdir(cifar10Data);         url https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz;         helperCIFAR10Data.download(url, cifar10Data);     end end [trainingImages, trainingLabels, testImages, testLabels] helperCIFAR10Data.load(cifar10Data); % Construct an imageDatastore object trainingSet imageDatastore(trainingImages, ...     labels, trainingLabels, ...     ReadFcn, helperCIFAR10Data.readFunction); testSet imageDatastore(testImages, ...     labels, testLabels, ...     ReadFcn, helperCIFAR10Data.readFunction); % Prepare the data for training inputSize [32 32 3]; numClasses 10; % Apply data augmentation augmentedTrainingSet augmentedImageDatastore(inputSize, ...     trainingSet, ...     ColorPreprocessing, gray2rgb, ...     RandCropSize, [28 28], ...     RandCropType, random, ...     RandRotation, [-8 8], ...     RandXReflection, true); % Load pre-trained DenseNet-201 network net densenet201; % Configure training options options trainingOptions(sgdm, ...     InitialLearnRate, 0.001, ...     MaxEpochs, 50, ...     MiniBatchSize, 128, ...     VerboseFrequency, 50, ...     Plots, training-progress); % Train the network trainedNet trainNetwork(augmentedTrainingSet, net, options); % Test the network predictedLabels classify(trainedNet, testSet); accuracy mean(predictedLabels testSet.Labels) % Visualize the results numImages 20; idx randsample(numel(testSet.Files), numImages); figure montage(testSet.Files(idx), Size, [4 5]); title(Test Images); predictedLabels classify(trainedNet, testSet); label cellstr(predictedLabels); label strcat(label, , , cellstr(num2str(testSet.Labels))); groundTruth cellstr(label); groundTruth strcat(Ground Truth: , groundTruth); predicted cellstr(predictedLabels); predicted strcat(Prediction: , predicted); for i 1:numImages     text(i*32-25,3210,groundTruth(idx(i)),FontSize,8)     text(i*32-25,3220,predicted(idx(i)),FontSize,8) end
http://www.hkea.cn/news/14543568/

相关文章:

  • 网站建设价格标准渠道上海到北京高铁票价多少
  • 企业官网建站的流程安徽省住房和城乡建设厅网站
  • 会python做网站科技创新网站建设策划书
  • 旗舰店的网站怎么做wordpress sha256
  • 商丘网站建设费用怎么在手机上制作网站吗
  • 网站突然排名没了国际新闻最新消息10条
  • 高端网站建设策划亚马逊跨境电商入门完整教程
  • 咨询公司网站建设163免费邮箱入口
  • 专业网站建设代理商科技企业网站如何建设
  • 徐州梦网科技做网站怎么样百度小程序如何做网站
  • 顺德品牌网站怎么做自已的网站
  • 免费搭建网站模板最新赚钱项目发布平台
  • 做网站标签栏的图片大小招生网站转换率低
  • 西安外贸网站建设网站设计公司地址
  • 惠州公司网站建设移动应用开发就业方向
  • 免费信息发布平台网站仿牌网站空间
  • 检察 网站建设计算机网络技术网站开发
  • 17网站一起做网店株洲废品回收在哪个网站做效果好
  • 不同类型企业网站的对比分析车上seo是什么意思
  • 做网站卖东西赚钱wordpress企业建站视频教程
  • 做分析图超牛的地图网站建站 备案
  • 设计做网站哪家公司好好用的免费建站网站
  • 自己做的网站绑定域名品牌推广服务
  • 电子科技产品东莞网站建设服装网站模板
  • 上海网站制作有名 乐云践新适合40岁女人的培训班
  • 济南专业的设计网站北京网站改版报价
  • 汽车行业网站建设比较好遵义网站建设服务
  • 南京企业网站制作价格古玩网站源码
  • 无锡富通电力建设有限公司网站电脑优化系统的软件哪个好
  • 怎么用div做网站常用网站开发软件