Main Content

sequenceUnfoldingLayer

(Not recommended) Sequence unfolding layer

SequenceUnfoldingLayer objects are not recommended. Most neural networks specified as a dlnetwork object do not require sequence folding and unfolding layers. In most cases, deep learning layers have the same behavior when there is no folding or unfolding layer. Otherwise, instead of using a SequenceUnfoldingLayer to manipulate the dimensions of data for downstream layers, define a custom layer functionLayer layer object that operates on the data directly. For more information, see Version History.

Description

A sequence unfolding layer restores the sequence structure of the input data after sequence folding.

To use a sequence unfolding layer, you must connect the miniBatchSize output of the corresponding sequence folding layer to the miniBatchSize input of the sequence unfolding layer.

Creation

Description

layer = sequenceUnfoldingLayer creates a sequence unfolding layer.

layer = sequenceUnfoldingLayer('Name',Name) creates a sequence unfolding layer and sets the optional Name property using a name-value pair. For example, sequenceUnfoldingLayer('Name','unfold1') creates a sequence unfolding layer with the name 'unfold1'. Enclose the property name in single quotes.

example

Properties

expand all

Layer name, specified as a character vector or a string scalar. For Layer array input, the trainNetwork function automatically assigns names to layers with the name "".

The SequenceUnfoldingLayer object stores this property as a character vector.

Data Types: char | string

Number of inputs of the layer.

This layer has two inputs:

  • 'in' – Input feature map.

  • 'miniBatchSize' – Size of the mini-batch from the corresponding sequence folding layer. This output must be connected to the 'miniBatchSize' output of the corresponding sequence folding layer.

Data Types: double

Input names of the layer.

This layer has two inputs:

  • 'in' – Input feature map.

  • 'miniBatchSize' – Size of the mini-batch from the corresponding sequence folding layer. This output must be connected to the 'miniBatchSize' output of the corresponding sequence folding layer.

Data Types: cell

Number of outputs from the layer, returned as 1. This layer has a single output only.

Data Types: double

Output names, returned as {'out'}. This layer has a single output only.

Data Types: cell

Examples

collapse all

Create a sequence unfolding layer.

Create a sequence unfolding layer with the name 'unfold1'.

layer = sequenceUnfoldingLayer('Name','unfold1')
layer = 
  SequenceUnfoldingLayer with properties:

          Name: 'unfold1'
     NumInputs: 2
    InputNames: {'in'  'miniBatchSize'}

Extended Capabilities

expand all

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

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2019a

collapse all