Code Generation for Deep Learning Networks;深度学习神经网络matlab 代码

该示例展示了如何为使用深度学习的图像分类应用进行代码生成。它使用`codegen`命令为MobileNet-v2、ResNet和GoogLeNet等图像分类网络生成MEX函数。该例子需要CUDA启用的NVIDIA GPU和兼容驱动,还可能需要NVIDIA工具包、cuDNN库和相应的环境变量。
摘要由CSDN通过智能技术生成

%% Code Generation for Deep Learning Networks
%
% This example shows how to perform code generation for an image
% classification application that uses deep learning. It uses the |codegen|
% command to generate a MEX function that runs prediction by using image
% classification networks such as MobileNet-v2, ResNet, and GoogLeNet.
%

%% Third-Party Prerequisites
% Required
%
% This example generates CUDA MEX and has the following third-party
% requirements.
%
% * CUDA® enabled NVIDIA® GPU and compatible driver.
%
% Optional
%
% For non-MEX builds such as static, dynamic libraries or executables,
% this example has the following additional requirements.
%
% * NVIDIA toolkit.
% * NVIDIA cuDNN library.
% * Environment variables for the compilers and libraries. For more
% information, see
% <docid:gpucoder_gs#mw_aa8b0a39-45ea-4295-b244-52d6e6907bff Third-party
% Products> and <docid:gpucoder_gs#mw_453fbbd7-fd08-44a8-9113-a132ed383275
% Environment Variables>.
%% Verify GPU Environment
% Use the <docid:gpucoder_ref#mw_0957d820-192f-400a-8045-0bb746a75278 coder.checkGpuInstall> function
% to verify that the compilers and libraries necessary for running this example
% are set up correctly.
envCfg = coder.gpuEnvConfig(‘host’);
envCfg.DeepLibTarget = ‘cudnn’;
envCfg.DeepCodegen = 1;
envCfg.Quiet = 1;
coder.checkGpuInstall(envCfg);
%% |mobilenetv2_predict| Entry-Point Function
%
% MobileNet-v2 is a convolutional neural network that is trained on more
% than a million images from the ImageNet database. The network is 155
% layers deep and can classify images into 1000 object categories, such as
% keyboard, mouse, pencil, and many animals. The network has an image
% input size of 224-by-224. Use the <docid:nnet_ref#mw_8d52b67d-b6b3-4c62-b573-56fdf4dce6a0 analyzeNetwork>
% function to display an interactive visualization of the dee

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值