Use MATLAB to Prototype Deep Learning on a Xilinx FPGA
基于FPGA的硬件非常适合在嵌入式设备上进行深入学习,因为它们提供了低延迟和功耗。早期原型制作对于开发可以有效部署到FPGA的深度学习网络至关重要。
See how Deep Learning HDL Toolbox™ automates FPGA prototyping of deep learning networks directly from MATLAB®。使用几行MATLAB代码,您可以在Xilinx上部署并运行推断®ZCU102 FPGA板。这种直接连接使您可以作为MATLAB应用程序的一部分在FPGA上进行深入学习推断,因此您可以在满足系统需求的网络上更快地收敛。
FPGAs are a good fit for deep learning inferencing in edge devices because they have lower latency, and use less power than CPUs or GPUs, and we’re starting to see them designed into a variety of applications.
但是,Edge部署带来了诸如速度,大小和功耗之类的限制,这些限制迫使权衡基于FPGA的硬件实施深度学习网络。因此,对于工程师来说,能够在网络设计和FPGA部署之间迭代至关重要。
With Deep Learning HDL Toolbox, you can get started running inferencing on an FPGA from MATLAB with as little as 5 lines of code added to your existing deep learning code, so you can experiment and iterate right in MATLAB.
要快速入门,请从附加探索器或Mathworks硬件支持页面下载深度学习HDL工具箱的Xi金宝applinx支持软件包。该软件包包括预先构建的Bitstreams,将深度学习处理器和数据移动功能编程到Xilinx ZCU102等流行板上。
这个深度学习专业cessor has modules that run convolution and fully connected layers, and you can compile a variety of deep learning networks to run on them without reprogramming the FPGA. The rest of the functionality controls the layers, along with movement and storage of the parameters and activations, plus the interfaces that allow MATLAB to talk to it directly over Ethernet or JTAG.
This is a lane detection example that uses a series network that already been trained. It will overlay lane markings on the video.
The first line of code you will need is to define your target object. In this case, the target is a Xilinx board, using the Ethernet interface.
The next line defines the workflow object, which specifies to use that target object, which bitstream – and in this case it’s the one we downloaded that uses single-precision floating-point calculations, so you don’t even need to quantize to fixed-point, and of course what network we want to program onto the target.
第三行编译了控制网络并生成参数的指令。当您迭代网络设计时,您可以重新编译并部署到处理器,
这是这里的第四行 - 部署函数。如果尚未对FPGA进行编程,则使用BITSTREAM编程。它加载了定义网络的编译指令以及其参数。
最后,第五行是在网络上呼吁在FPGA上运行预测的一行。通常,您会像这里一样在MATLAB算法中使用它。
And that’s it, you can try your network running on the FPGA in the context of your algorithm.
Here because we load one image at a time from MATLAB to the FPGA, it appears to be running slowly, but assessing the performance profile it’s not too bad. We can make adjustments to the network right from here, recompile, and re-assess performance with just a few lines of MATLAB code.
So you can get immediate feedback on how it performs on an FPGA without having to burden the hardware team, and ultimately you can generate HDL for a deep learning processor that you know can be implemented in hardware.
这5行MATLAB代码是我们整个示例套件的共同主题,因此您可以使用与应用程序最相似的示例之一尝试。
Related Products
Featured Product
Deep Learning HDL Toolbox
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(意大利语)
- Luxembourg(English)
- 荷兰(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia(English)
- India(English)
- 新西兰(English)
- 中国
- 日本Japanese(日本語)
- 한국Korean(한국어)