RegressionNeuralNetwork Predict - Predict responses using neural network regression model - Simulink (original) (raw)

Predict responses using neural network regression model

Since R2021b

Libraries:
Statistics and Machine Learning Toolbox / Regression

Description

The RegressionNeuralNetwork Predict block predicts responses using a neural network regression object (RegressionNeuralNetwork or CompactRegressionNeuralNetwork).

Import a trained regression object into the block by specifying the name of a workspace variable that contains the object. The input port x receives an observation (predictor data), and the output port yfit returns a predicted response for the observation.

Examples

Ports

Input

expand all

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Output

expand all

Predicted response, returned as a scalar.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Parameters

expand all

Main

Data Types

Fixed-Point Operational Parameters

Data Type

Specify the data type for the output layer. The type can be inherited, specified directly, or expressed as a data type object such asSimulink.NumericType.

When you select Inherit: Inherit via internal rule, the block uses an internal rule to determine the output data type. The internal rule chooses a data type that optimizes numerical accuracy, performance, and generated code size, while taking into account the properties of the embedded target hardware. The software cannot always optimize efficiency and numerical accuracy at the same time.

For more information about data types, see Control Data Types of Signals (Simulink).

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the data type attributes. For more information, see Specify Data Types Using Data Type Assistant (Simulink).

Programmatic Use

Block Parameter:OutputLayerDataTypeStr
Type: character vector
Values: 'Inherit: Inherit via internal rule' | 'double' 'single' 'half' 'int8' 'uint8' 'int16' 'uint16' 'int32' 'uint32' 'int64' 'uint64' 'boolean' 'fixdt(1,16,0)' 'fixdt(1,16,2^0,0)' ''
Default: 'Inherit: Inherit via internal rule'

Specify the lower value of the output layer's internal variable range checked by Simulink.

Simulink uses the minimum value to perform:

Note

The Output layer data type Minimum parameter does not saturate or clip the output layer value signal.

Programmatic Use

Block Parameter:OutputLayerOutMin
Type: character vector
Values: '[]' | scalar
Default: '[]'

Specify the upper value of the output layer's internal variable range checked by Simulink.

Simulink uses the maximum value to perform:

Note

The Output layer data type Maximum parameter does not saturate or clip the output layer value signal.

Programmatic Use

Block Parameter:OutputLayerOutMax
Type: character vector
Values: '[]' | scalar
Default: '[]'

Specify the data type for the first layer. The type can be inherited, specified directly, or expressed as a data type object such asSimulink.NumericType.

When you select Inherit: Inherit via internal rule, the block uses an internal rule to determine the data type. The internal rule chooses a data type that optimizes numerical accuracy, performance, and generated code size, while taking into account the properties of the embedded target hardware. The software cannot always optimize efficiency and numerical accuracy at the same time.

For more information about data types, see Control Data Types of Signals (Simulink).

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the data type attributes. For more information, see Specify Data Types Using Data Type Assistant (Simulink).

Tips

A trained neural network can have more than one fully connected layer, excluding the output layer.

Programmatic Use

Block Parameter:Layer1DataTypeStr
Type: character vector
Values: 'Inherit: Inherit via internal rule' | 'double' 'single' 'half' 'int8' 'uint8' 'int16' 'uint16' 'int32' 'uint32' 'int64' 'uint64' 'boolean' 'fixdt(1,16,0)' 'fixdt(1,16,2^0,0)' ''
Default: 'Inherit: Inherit via internal rule'

Specify the lower value of the first layer's internal variable range checked by Simulink.

Simulink uses the minimum value to perform:

Note

The Layer 1 data type Minimum parameter does not saturate or clip the first layer value signal.

Tips

A trained neural network can have more than one fully connected layer, excluding the output layer.

Programmatic Use

Block Parameter:Layer1OutMin
Type: character vector
Values: '[]' | scalar
Default: '[]'

Specify the upper value of the first layer's internal variable range checked by Simulink.

Simulink uses the maximum value to perform:

Note

The Layer 1 data type Maximum parameter does not saturate or clip the first layer value signal.

Tips

A trained neural network can have more than one fully connected layer, excluding the output layer.

Programmatic Use

Block Parameter:Layer1OutMax
Type: character vector
Values: '[]' | scalar
Default: '[]'

Block Characteristics

Data Types Boolean | double fixed point half integer single
Direct Feedthrough yes
Multidimensional Signals no
Variable-Size Signals no
Zero-Crossing Detection no

More About

expand all

The data types of internal model parameters are synchronized to the data type of the output port, yfit.

Alternative Functionality

You can use a MATLAB Function block with the predict object function of a neural network regression object (RegressionNeuralNetwork or CompactRegressionNeuralNetwork). For an example, see Predict Class Labels Using MATLAB Function Block.

When deciding whether to use the RegressionNeuralNetwork Predict block in the Statistics and Machine Learning Toolbox™ library or a MATLAB Function block with the predict function, consider the following:

Extended Capabilities

Version History

Introduced in R2021b

See Also

Blocks

Objects

Functions

Topics