Simulink中的深度学习金宝app
用MATLAB®R2020b,您可以使用深度学习工具箱™块库以及MATLAB函数块在Simulink中模拟和生成经过训练的深度学习模型的代码金宝app®。
了解如何在Simulink中使用控制、信号处理和传感器融合组件模拟深度学习网络,以评估深度学习模型对系金宝app统级性能的影响。了解更多关于使用NVIDIA的信息®gpu加速Simulink中深度学习网络模型的执行。金宝app
截至R2020b发布的MATLAB®,您可以使用MATLAB函数块以及深度学习工具箱™块库在Simulink中模拟和生成经过训练的深度学习模型的代码金宝app®。例如,要设计高速公路车道跟踪系统,您可以使用深度学习块创建一个执行车道和车辆检测的Simulink子系统,将该子系统与包含车辆动力学模型、车道跟踪控制器、传感器融合和3D可视化等附加组件的更大的Simulink金宝app模型集成,并在部署前通过系统级仿真验证整体设计的性能。让我们看看如何在Simulink中创建一个执行车辆和车道检测的子系统。金宝app我们首先需要的是一个c++编译器。我们还需要支持包,提供从MATLAB Cod金宝apper™和GPU Coder™到特定目标深度学习库的接口。最后,我们假设我们有一个预训练的车道检测网络,以及一个预训练的yolov2车辆检测器存储在MATLAB文件中。在Simuli金宝appnk模型中,我们从交通视频文件中读取,在车辆和车道检测部分之后,我们再次显示带有车道和车辆注释的交通视频。对于车道检测,首先我们调整视频帧的大小,以匹配经过训练的车道检测网络预期的输入。接下来,我们将使用深度学习块库中的“Predict”块对训练好的网络进行推理。为了将块链接到车道检测器对象,我们提供了相应MATLAB文件的路径。 Another option here would be to use a MATLAB function. The predict block will output two lane boundaries represented by a parabolic equation with 3 parameters that are then transformed into lanes in image coordinates. For vehicle detection, we will use a MATLAB Function block to perform inference on the pretrained yolov2 vehicle detector. Inside the MATLAB Function block we will load the pretrained network, and call the detect method to get the bounding boxes and associated confidence scores. Next, we will specify the dimensions of the block outputs. The MATLAB Function block can also be used with other types of networks like LSTMs, and you can also use it to output activations from specific layers of the network. The last thing we need to do before we run the simulation, is to set the simulation target language to C++ in the model settings. Clicking the Run button will under the hood generate code from the Predict and MATLAB Function blocks and compile it for CPU-accelerated simulation. The output of the simulation displays the annotated traffic video as expected. Finally, you can also use GPU Coder with NVIDIA®gpu加速Simulink中深度学习模型的仿真。金宝app要配置GPU加速的模型,请勾选模型设置中模拟目标下的“GPU加速”框。一旦系统设计在仿真中得到验证,您就可以从Simulink模型生成用于部署的代码。金宝app您可以使用Simulin金宝appk Coder™,嵌入式编码器®或GPU Coder生成c++或CUDA代码,并在英特尔上部署深度学习网络®、手臂®或NVIDIA平台。
您也可以从以下列表中选择一个网站:
如何获得最佳的网站性能
选择中国站点(中文或英文)以获得最佳站点性能。其他MathWorks国家站点没有针对您所在位置的访问进行优化。