양자화 및 가지치기
양자화 또는 가지치기를 수행하여 심층 신경망 압축
Deep Learning Toolbox™와 함께 Deep Learning Toolbox Model Quantization Library 지원 패키지를 사용하여 심층 신경망의 메모리 사용량과 계산 요구 사항을 줄이려면 다음과 같이 하십시오.
계층의 가중치, 편향 및 활성화를 정수 데이터형으로 스케일링한 낮은 정밀도로 양자화합니다. 그런 다음 양자화된 신경망에서 C/C++, CUDA® 또는 HDL 코드를 생성할 수 있습니다.
C/C++ 및 CUDA 코드 생성 시, 컨벌루션 계층의 가중치, 편향 및 활성화를 8비트로 스케일링된 정수 데이터형으로 양자화하여 컨벌루션 심층 신경망용 코드를 생성합니다. 양자화는
calibrate
함수에 의해 생성된 보정 결과 파일을codegen
(MATLAB Coder) 명령에 제공하여 수행됩니다.quantize
함수에 의해 생성된 양자화된 심층 신경망은 코드 생성에 지원되지 않습니다.1차 테일러 근사를 사용하여 컨벌루션 계층에서 필터를 가지치기합니다. 그런 다음 가지치기된 신경망에서 C/C++ 또는 CUDA 코드를 생성할 수 있습니다.
함수
앱
심층 신경망 양자화기 | Quantize a deep neural network to 8-bit scaled integer data types |
도움말 항목
딥러닝 양자화
- Quantization of Deep Neural Networks
Understand effects of quantization and how to visualize dynamic ranges of network convolution layers. - Quantization Workflow Prerequisites
Products required for the quantization of deep learning networks.
GPU 타깃을 위한 양자화
- Generate INT8 Code for Deep Learning Networks (GPU Coder)
Quantize and generate code for a pretrained convolutional neural network. - Quantize Residual Network Trained for Image Classification and Generate CUDA Code
This example shows how to quantize the learnable parameters in the convolution layers of a deep learning neural network that has residual connections and has been trained for image classification with CIFAR-10 data. - Quantize Layers in Object Detectors and Generate CUDA Code
This example shows how to generate CUDA® code for an SSD vehicle detector and a YOLO v2 vehicle detector that performs inference computations in 8-bit integers for the convolutional layers.
FPGA 타깃을 위한 양자화
- Deploy INT8 Network to FPGA (Deep Learning HDL Toolbox)
Reduce the memory footprint of a deep neural network by quantizing the weights, biases, and activations of convolution layers to 8-bit scaled integer data types. - Classify Images on an FPGA Using a Quantized DAG Network (Deep Learning HDL Toolbox)
In this example, you use Deep Learning HDL Toolbox™ to deploy a quantized deep convolutional neural network and classify an image. - Classify Images on FPGA by Using Quantized GoogLeNet Network (Deep Learning HDL Toolbox)
This example show how to use the Deep Learning HDL Toolbox™ to deploy a quantized GoogleNet network to classify an image.
CPU 타깃을 위한 양자화
- Generate int8 Code for Deep Learning Networks (MATLAB Coder)
Quantize and generate code for a pretrained convolutional neural network. - Generate INT8 Code for Deep Learning Network on Raspberry Pi (MATLAB Coder)
Generate code for deep learning network that performs inference computations in 8-bit integers.
가지치기
- Parameter Pruning and Quantization of Image Classification Network
Use parameter pruning and quantization to reduce network size. - Prune Image Classification Network Using Taylor Scores
This example shows how to reduce the size of a deep neural network using Taylor pruning. - Prune Filters in a Detection Network Using Taylor Scores
This example shows how to reduce network size and increase inference speed by pruning convolutional filters in a you only look once (YOLO) v3 object detection network.