Main Content

dlhdl.Workflow Class

Namespace: dlhdl

Configure deployment workflow for deep learning neural network

Since R2020b

Description

Use the dlhdl.Workflow object to set options for compiling and deploying your deep learning network to a target FPGA. You create an object of the dlhdl.Workflow class for the specified deep learning network and FPGA bitstream. Use the object to:

  • Compile the deep learning network.

  • Estimate the speed and throughput of your network on the specified FPGA device.

  • Compile and deploy the neural network onto the FPGA.

  • Predict the class of input images.

  • Profile the results for the specified network and the FPGA.

Creation

hW = dlhdl.Workflow('Network',Network,'Bitstream',Bitstream) creates a workflow configuration object with a network object, bitstream, and target object to deploy your custom pretrained deep learning network object.

hW = dlhdl.Workflow('Network',Network,'Bitstream',Bitstream,Name,Value) creates a workflow configuration object with a network object and bitstream to deploy your custom pretrained deep learning network object, with additional options specified by one or more name-value pair arguments.

Input Arguments

expand all

Name of the FPGA bitstream, specified as a character vector or a dlhdl.Bitstream object.. Make sure that the bitstream name matches the data type and the FPGA board that you are targeting. For a list of provided bitstream names, see Use Deep Learning on FPGA Bitstreams.

Example: 'Bitstream', 'arria10soc_single' specifies that you want to deploy the trained network with single data types to an Arria10 SoC board.

Name of the deep learning network object.

Example: 'network', net creates a workflow object for the saved pretrained network net. To specify net, you can import any of the existing supported pretrained networks or use transfer learning to adapt the network to your issue. See Supported Pretrained Networks.

When the network is of type dlnetwork :

  • The dlnetwork object must be initialized.

  • The first layer of the dlnetwork object must be an image input layer.

net = resnet18;
hW = dlhdl.Workflow('Network',net,'Bitstream','zcu102_single');

Example: 'network', dlquantizeObj creates a workflow object for the quantized network object dlquantizeObj. To specify dlquantizeObj, you can import any of the supported existing pretrained networks and create an object by using the dlquantizer class. For information on supported networks, see Supported Pretrained Networks.

net = resnet18;
dlquantObj = dlquantizer(net,'ExecutionEnvironment','FPGA');
dlquantObj.calibrate(imdsTrain);
hW = dlhdl.Workflow('Network',dlquantObj,'Bitstream','zcu102_int8');

Properties

expand all

Target object specified as dlhdl.Target object

Example: 'Target',hTarget

hTarget = dlhdl.Target('Intel','Interface','JTAG')
hW = dlhdl.Workflow('network', snet,'Bitstream','arria10soc_single','Target',hTarget);

Methods

expand all

Examples

Create Workflow Object by using Property Name Value Pairs

[net,classNames] = imagePretrainedNetwork("vgg19");
hW = dlhdl.Workflow(Network=net,Bitstream="arria10soc_single",Target=hTarget);

Create Workflow Object with Quantized Network Object

[net,classNames] = imagePretrainedNetwork("resnet18");
dlQuantObj = dlquantizer(net,'ExecutionEnvironment','fpga');
inputSize = net.Layers(1).InputSize;
img = rand(inputSize);
dlQuantObj.calibrate(img)
qNet = dlquantObj.quantize;
hTarget = dlhdl.Target('Xilinx',Interface="Ethernet");
hW = dlhdl.Workflow(Network=qNet,Bitstream="zcu102_int8",Target=hTarget);

Version History

Introduced in R2020b