Why does multiple inputs with "sequenceInputLayer" return an error?

I am trying to build a neural network with multiple inputs. The first input is an “imageInputlayer” with 3 channels (6 x 6 x 3) followed by some convolution and ReLU layers. The second input is a “sequenceInputLayer” which takes a vector input (3 x 1). This architecture is based on the following MATLAB Answers post: 
When I try to train the network, I get the following error: 
Invalid Input layers. If the network has a sequence input layer, then it must not have any other input layer.”
Is there a workaround for this error? 

 采纳的回答

A workaround for this error is converting the “sequenceInputLayer” to an “imageInputLayer” that takes as input an image with a single channel (a 3 x 1 x 1 vector). This is done by changing the instance of: 
>>sequenceInputLayer (3, "Name", "sequence")
to  
>>imageInputLayer( [3 1 1], "Name", "sequence")
Both “sequenceInputLayer” and “imageInputLayer” take variable sized inputs and pass them to subsequent layers. The key difference is that “imageInputLayer” defaults to ‘zerocenter’ normalization while “sequenceInputLayer” defaults to no normalization. The specifications of the “imageInputLayer” can be changed to mirror the normalization of “sequenceInputLayer” by altering the 'Normalization’ parameter to ‘none’.  
For example, the “imageInputLayer” can be created as such: 
>>imageInputLayer( [3 1 1], "Name", "sequence", "Normalization", "none")
A couple documentation pages identify this difference and indicate that there are no additional differences between the layers. The documentation page for "imageInputLayer" is:
the documentation page for "sequenceInputLayer" is:

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

产品

版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by