Main Content

Convolution 1D Layer

1-D convolutional layer

Since R2024b

  • Convolution 1D Layer block

Libraries:
Deep Learning Toolbox / Deep Learning Layers / Convolution and Fully Connected Layers

Description

The Convolution 1D Layer block applies sliding convolutional filters to 1-D input. The layer convolves the input by moving the filters along the input and computing the dot product of the weights and the input, then adding a bias term.

The dimension that the layer convolves over depends on the layer input:

  • For time series and vector sequence input in the CT format (two dimensions corresponding to channels and time steps, in that order), the layer convolves over the time dimension.

  • For 1-D image input in the SC format (two dimensions corresponding to spatial pixels and channels, in that order), the layer convolves over the spatial dimension.

The exportNetworkToSimulink function generates this block to represent a convolution1dLayer object.

Limitations

  • The Layer parameter has limited support for the 'manual' padding mode and does not support the 'causal' padding mode. It is recommended to use a convolution1dLayer object that has the PaddingMode property set to 'same'.

  • The Layer parameter does not support convolution1dLayer objects that have the PaddingValue property set to "symmetric-exclude-edge". If you specify an object that uses that padding value, the block produces a warning and uses the value "symmetric-include-edge" instead.

  • The Layer parameter does not support convolution1dLayer objects that have the DilationFactor property set to a value other than 1.

Ports

Input

expand all

Input data on which to perform the convolution operation. The data must have two dimensions corresponding to the format that you specify with the Data format block parameter.

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

Output

expand all

The result of convolving the input data. The output data has two dimensions corresponding to the format that you specify with the Data format block parameter.

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

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Main

Specify the name of a workspace variable that contains a convolution1dLayer object from a trained network. The Convolution 1D Layer block configures itself by using the properties of the object and calculates the block output by using the learnable parameters of the object.

Programmatic Use

Block Parameter: Layer
Type: workspace variable
Values: convolution1dLayer object
Default: 'layer'

Data format for the input data. The options use the same notation as the fmt argument of the dlarray object, except layer blocks do not support the Batch (B) dimension and instead assume an observation number of 1.

Programmatic Use

Block Parameter: DataFormat
Type: character vector
Values: 'CT' | 'SC'
Default: 'CT'

Data Types

The block casts the value of the Weights property of the object that you specify with the Layer parameter to this data type. The type can be inherited, specified directly, or expressed as a data type object such as Simulink.NumericType.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: WeightsDataTypeStr
Values: 'Inherit: Inherit via back propagation' (default) | 'Inherit: Inherit from 'Constant value'' | <data type expression>

The block casts the value of the Bias property of the object that you specify with the Layer parameter to this data type. The type can be inherited, specified directly, or expressed as a data type object such as Simulink.NumericType.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: BiasDataTypeStr
Values: 'Inherit: Inherit via back propagation' (default) | 'Inherit: Inherit from 'Constant value'' | <data type expression>

Choose the data type of the accumulator for each Convolution block inside the Convolution 1D Layer block. The type can be inherited, specified directly, or expressed as a data type object such as Simulink.NumericType. When you choose Inherit: Inherit via internal rule, Simulink chooses a data type to balance numerical accuracy, performance, and generated code size, while taking into account the properties of the embedded target hardware.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: AccumDataTypeStr
Values: 'Inherit: Inherit via internal rule' (default) | 'Inherit: Same as first input' | <data type expression>

Execution

Specify the discrete interval between sample time hits or specify another type of sample time, such as continuous (0) or inherited (-1). For more options, see Types of Sample Time (Simulink).

By default, the block inherits its sample time based upon the context of the block within the model.

Programmatic Use

Block Parameter: SampleTime
Type: character vector
Values: scalar
Default: '-1'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2024b