Main Content

coder.ARMNEONConfig

Parameters to configure deep learning code generation with theARMCompute Library

Description

Thecoder.ARMNEONConfigobject contains ARM®Compute Library and target specific parameters thatcodegenuses for generating C++ code for deep neural networks.

To use acoder.ARMNEONConfigobject for code generation, assign it to theDeepLearningConfigproperty of a code generation configuration object that you pass tocodegen.

克雷亚tion

克雷亚te an ARM NEON configuration object by using thecoder.DeepLearningConfigfunction with target library set as'arm-compute'.

Properties

expand all

Version of ARM Compute Library used on the target hardware, specified as a character vector or string scalar. If you setArmComputeVersionto a version later than'20.02.1',ArmComputeVersionis set to'20.02.1'.

ARM architecture supported in the target hardware, specified as a character vector or string scalar. The specified architecture must be the same as the architecture for the ARM Compute Library on the target hardware.

ARMArchitecturemust be specified for these cases:

  • You do not use a hardware support package (theHardwareproperty of the code generation configuration object is empty).

  • You use a hardware support package, but generate code only.

Specify the precision of the inference computations in supported layers. When performing inference in 32-bit floats, use'fp32'. For 8-bit integer, use'int8'. Default value is'fp32'.

Location of the MAT-file containing the calibration data. Default value is''. This option is applicable only whenDataTypeis set to'int8'.

When performing quantization, thecalibrate(Deep Learning Toolbox)function exercises the network and collects the dynamic ranges of the weights and biases in the convolution and fully connected layers of the network and the dynamic ranges of the activations in all layers of the network. To generate code for the optimized network, save the results from thecalibratefunction to a MAT-file and specify the location of this MAT-file to the code generator using this property. For more information, seeGenerate int8 Code for Deep Learning Networks.

Name of target library, specified as a character vector.

Examples

collapse all

克雷亚te an entry-point functionsqueezenetthat uses thecoder.loadDeepLearningNetworkfunction to load thesqueezenet(Deep Learning Toolbox)object.

functionout = squeezenet_predict(in)persistentmynet;ifisempty(mynet) mynet = coder.loadDeepLearningNetwork('squeezenet','squeezenet');endout = predict(mynet,in);

克雷亚te acoder.configconfiguration object for generation of a static library.

cfg = coder.config('lib');

Set the target language to C++. Specify that you want to generate only source code.

cfg.TargetLang ='C++'; cfg.GenCodeOnly=true;

克雷亚te acoder.ARMNEONConfigdeep learning configuration object. Assign it to theDeepLearningConfigproperty of thecfgconfiguration object.

dlcfg = coder.DeepLearningConfig('arm-compute'); dlcfg.ArmArchitecture ='armv8'; dlcfg.ArmComputeVersion ='20.02.1'; cfg.DeepLearningConfig = dlcfg;

Use the-configoption of thecodegenfunction to specify thecfgconfiguration object. Thecodegenfunction must determine the size, class, and complexity of MATLAB®function inputs. Use the-argsoption to specify the size of the input to the entry-point function.

codegen-args{ones(227,227,3,'single')}-configcfgsqueezenet_predict

Thecodegen命令所有生成的文件的地方codegenfolder. The folder contains the C++ code for the entry-point functionsqueezenet_predict.cpp, header, and source files containing the C++ class definitions for the convolutional neural network (CNN), weight, and bias files.

Version History

Introduced in R2019a