dlhdl.Workflow - Configure deployment workflow for deep learning neural network - MATLAB (original) (raw)
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 thedlhdl.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](#mw%5F2d050d2f-0346-49d3-b057-cfad278343e0),'Bitstream',[Bitstream](#mw%5Ffc2d56d7-36c8-429d-a7e6-3ef35d39be46))
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](#mw%5F2d050d2f-0346-49d3-b057-cfad278343e0),'Bitstream',[Bitstream](#mw%5Ffc2d56d7-36c8-429d-a7e6-3ef35d39be46),`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
Bitstream
— Name of the FPGA bitstream
'' (default) | character vector | dlhdl.Bitstream
Name of the FPGA bitstream, specified as a character vector or adlhdl.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.
Network
— Network object
SeriesNetwork
object | DAGNetwork
object | dlquantizer
object | dlnetwork
object | quantize
object
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 specifydlquantizeObj
, 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
'Target'
— dlhdl.Target
object to deploy network and bitstream to the target device
hTarget
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
Public Methods
activations | Retrieve intermediate layer results for deployed deep learning network |
---|---|
compile | Compile workflow object |
deploy | Deploy the specified neural network to the target FPGA board |
getBuildInfo | Retrieve bitstream resource utilization |
getStatusRegisterList | Retrieve names and descriptions of debug status registers |
predict | Predict responses by using deployed network |
predictAndUpdateState | Predict responses by using a trained and deployed recurrent neural network and update the deployed network state |
readStatusRegister | Read debug status registers |
resetState | Reset state parameters of deployed neural network |
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