predict
Description
predicts response of eNPU based on given data. response
= predict(enpu
,InputSignal
)
Examples
Predict response of eAI network by selecting the option to quantize
the input and then providing the input data of single
data type.
Create hexagon.ENPU
System object, by specifying the eAI network
file and the input and output quantization range.
enpu = hexagon.ENPU('EAINetworkFile','model_eNPU_on_v3.eai',... 'InputQuantizationRange',[-6 2.5],... 'DequantizeOutput',true,... 'OutputQuantizationRange',[0 1]);
Specify the input signal and call the predict
function to
obtain the response from the deep learning network .
x = 3.5 response = predict(enpu, x)
Input Arguments
hexagon.ENPU
System object
The input signal, specified as an N-dimensional array. The
array must be of the same size specified in the Input layer size
parameter of the eAI model.
The hexagon.ENPU
System object supports multiple-input
multiple-output tensor with a maximum of four dimensions, but the batch size must always
be 1. For example, if the input layer of the original deep learning network is
128-by-128-by-3, the input signal dimension must be either 128-by-128-by-3 or
1-by-128-by-128-by-3.
If the leading dimensions are 1 (singleton dimensions), you can remove these dimensions without affecting compatibility. For example, if the input layer of an AI model expects an input of size 1-by-1-by-128-by-3, you can specify an input of size 1-by-1-by-128-by-3 or 128-by-3. You can remove these dimensions because dimensions of size 1 can be broadcast to match the expected shape.
The predict
function accepts either floating-point input (which
requires quantization using other block parameters) or fixed-point input.
Data type of input signal must match with the eAI model if its input layer is of
type int8
, int16
or int32
. If
the input signal data type is single
, set the property
InputQuantizationRange
during hexagon.ENPU
object creation, before using the predict
function.
Data Types: single
| int8
| int16
| int32
Output Arguments
The response after computing predictions using the selected eAI model, represented
as an N-dimensional array. The array is of the same size as
specified in the Output layer size
parameter of the eAI model.
The hexagon.ENPU
System object supports a multiple-input
multiple-output tensor with a maximum of four dimensions, but the batch size must always
be 1.
The predict
function always returns quantized data, with the
data type as int8
, int16
or
int32
as per the eAI network. To obtain single-precision output,
set the property DequantizeOutput
to true
and
specify the OutputQuantizationRange
value during
hexagon.ENPU
object creation.
Version History
Introduced in R2025a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)