Why does multiple inputs with "sequenceInputLayer" return an error?
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 9 Lug 2020
Risposto: MathWorks Support Team
il 5 Gen 2021
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?
Risposta accettata
MathWorks Support Team
il 9 Lug 2020
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Data Workflows in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!