Main Content

dlhdl.Simulator Class

Namespace: dlhdl

Create an object that retrieves intermediate layer results and validate deep learning network prediction accuracy

Since R2021b

dlhdl.Simulator will be removed in a future release. For quantized networks use the quantize object instead.

Description

Use the dlhdl.Simulator class to creates a simulator object that you use to retrieve intermediate layer results and verify the accuracy of prediction results for your deep learning network without the need for hardware targets.

Creation

simObj=dlhdl.Simulator('Network',Network,'ProcessorConfig',ProcessorConfig) creates a dlhdl.Simulator object that you use to retrieve intermediate layer results and verify the accuracy of prediction results for your deep learning network without the need for hardware targets.

Input Arguments

expand all

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.

net = resnet18;
hPC = dlhdl.ProcessorConfig;
simObj = dlhdl.Simulator('Network',net,'ProcessorConfig',hPC);

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);
simObj = dlhdl.Simulator('Network',dlquantObj,'ProcessorConfig',hPC);

Deep learning processor configuration object, specified as a dlhdl.ProcessorConfig object

Example: 'ProcessorConfig',hPC

hPC = dlhdl.ProcessorConfig;
simObj = dlhdl.Simulator('Network',resnet18,'ProcessorConfig',hPC);

Methods

expand all

Examples

collapse all

  1. Retrieve the deep learning processor configuration for the zcu102_single bitstream and save to hPC.

    hPC = dlhdl.ProcessorConfig('Bitstream','zcu102_single');

  2. Create a dlhdl.Simulator object with resnet18 as the network and hPC as the ProcessorConfig object.

    simObj = dlhdl.Simulator('Network',resnet18,'ProcessorConfig',hPC);

  1. Create a deep learning processor configuration that has the int8 data type and save it to hPC.

    hPC = dlhdl.ProcessorConfig;
    hPC.ProcessorDataType = 'int8';

  2. Create a dlquantizer object with ResNet-18 as the network and FPGA execution environment. Calibrate the quantized network object by using the calibrate function.

    net = resnet18;
    dlQuantObj = dlquantizer(net,'ExecutionEnvironment','FPGA');
    dlQuantObj.calibrate(imageDataStore);

  3. Create a dlhdl.Simulator object with dlQuantObj as the network and hPC as the ProcessorConfig object.

    simObj = dlhdl.Simulator('Network',dlQuantObj,'ProcessorConfig',hPC);

Limitations

dlhdl.Simulator object does not support:

  • Multiple input networks

  • Multiple output networks

  • Sequence input layer

  • Word embedding layer

  • Long short-term memory (LSTM) layer

  • Gated recurrent unit (GRU) layer

  • Projected LSTM layer

  • dlnetwork object

Version History

Introduced in R2021b

expand all