Forums - multiple DLCs network

3 posts / 0 new
Last post
multiple DLCs network
alona.rimon
Join Date: 18 May 23
Posts: 3
Posted: Thu, 2023-05-18 00:25

Hello,
I use zdl::SNPE to run networks on SNPE.
I have a neural network that I have divided myself into sub-networks, with each sub-network having a different DLC.
I want to control the running order of the subnets. And in addition, for example - in some of the runs I want one subnet not to be activated at all.
Do I have to create a separate zdl::SNPE::SNPE object for each of them? (And then control them like you control several completely separate networks?)
Or is there another solution supported by your API for cpp?

  • Up0
  • Down0
sa.m.ira.akhlaqi314
Join Date: 19 May 23
Posts: 1
Posted: Fri, 2023-05-19 01:18

Hello,

To control the running order of sub-networks and selectively activate or deactivate certain subnets using zdl::SNPE, you don't need to create separate SNPE objects for each subnet. Instead, you can achieve this functionality by modifying the network input data appropriately.
 
Here's an approach you can follow:
 
Load all the sub-networks (DLC files) into a single SNPE object.
Prepare your input data for inference. Make sure the input data contains information that can control the activation or deactivation of the subnets. For example, you can use an additional input tensor to specify whether a subnet should be activated or not.
Pass the modified input data to the SNPE object for inference. Ensure that the input data is properly formatted according to the requirements of your network.
Process the inference results accordingly.
By including information in the input data to control the activation or deactivation of subnets, you can achieve the desired behavior without creating separate SNPE objects. This approach allows you to control the running order of subnets and selectively activate or deactivate specific subnets during inference. 

 

  • Up0
  • Down0
alona.rimon
Join Date: 18 May 23
Posts: 3
Posted: Sun, 2023-05-21 04:21
Thank you very much for the answer.
Do you have any tutorial that shows an example of such use?

I don't quite understand how the SNPE understands according to the input, which subnet to activate.
Also, according to what I understood from the API, when the builder is initialized, <zdl::DlContainer::IDlContainer> is passed to it
which is a wrapper to a single DLC file. I'm wrong?

 

Another question-
In terms of optimization, is there an advantage to the method you described over the production of several SNPE objects?
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.