quantizing a deep learning network in matlab video -凯发k8网页登录
in this video, we demonstrate the deep learning quantization workflow in matlab. using the model quantization library support package, we illustrate how you can calibrate, quantize, and validate a deep learning network such as resnet50. we also highlight the impact of quantization on reducing the memory of some standard networks such as resnet101 and inceptionv3.
deep learning quantization is a key optimization strategy for efficient deployment of deep learning networks, particularly on embedded platforms.
i am ram cherukuri, senior product manager at mathworks and in this video i will give you an overview of the deep learning quantization workflow in matlab.
quantizing the weights, biases, and activations to lower precision data types like int8 or fp16 significantly reduces the memory footprint of the ai algorithm and can result in improved inference performance on the embedded hardware.
you can use the model quantization library support package for quantizing your deep learning network in matlab. you can download it from the add-on explorer as shown here.
the quantization workflow leverages instrumentation, based on a calibration datastore to compute the instrumentation statistics that are used to quantize the weights, biases, and activations of the layers of the network.
finally, the validation step computes accuracy metrics to analyze and understand the impact of quantization on the accuracy of the network. let’s take resnet50 as an example network to go through this workflow.
here is the deep learning quantizer app, where you first import the network from the matlab workspace and you will see the network structure displayed on the left side pane.
next, you select the data store that you would like to use for calibration and the app displays the computed statistics such as the min and max values of weights, biases, and activations of each layer. you can also choose the layers that you can quantize and then validate the impact of quantization using a validation datastore.
in this example, we have used the default top 1 accuracy metric and you can see that there is a 67% reduction in memory with no drop in accuracy. you can then proceed to generate code from the quantized network for deployment.
we repeated this workflow with a few networks, only quantizing the compute-intensive conv layers to int8.
you can see the impact of quantization in the chart here. for instance, the largest network here with 180 mb in memory, resnet101, sees 72% compression with 2% drop in accuracy. inceptionv3, on the other hand, has the largest drop in accuracy of 4%, with 67% compression, going from 100 mb to 33 mb in memory.
this highlights the significant impact of quantization for efficient deployment of deep learning networks.
please refer to the resources below the video to learn how to get started and explore these new capabilities in matlab.
featured product
deep learning toolbox
up next:
related videos:
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)