Documented valid name-value pair argument is not recognised as parameter, for sequenceFolding and unfolding -layers

Hello,
I am trying to build a convolutional NN to classify time series data, and later combine it with an LSTM (similar to this study: LSTM Fully Convolutional Networks for Time Series Classification, Karim et al.)
To be able to use convolutional layer on time series MatLab gave me an error and suggested i use a sequenceFoldingLayer and sequenceUnfoldingLayer before and after the convolution layer. I Have not included both layers but get the following error:
Error using sequenceFoldingLayer>iParseInputArguments (line 74)
'NumOutputs' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this
function.
However, as stated in the documentation, 'NumOutputs' is a valid name-pair argument, and I do not understand why I cannot use it. If I try to not set 'NumOutputs' I get an error of unused output and input from the folding and unfolding layers because of a mismatch between the miniBatchSizes.
I have the following layers for the network setup:
inputSize = 1;
nClasses = 2;
miniBatchSize = 10;
layers = [...
sequenceInputLayer(inputSize,'Name','InputLayer')
sequenceFoldingLayer('NumOutputs', miniBatchSize,'Name', 'fold')
convolution2dLayer(5,10)
batchNormalizationLayer('Name', 'BN')
reluLayer('Name','ReLu')
sequenceUnfoldingLayer('NumInputs', miniBatchSize,'Name','unfold')
fullyConnectedLayer(nClasses)
softmaxLayer
classificationLayer];

 Accepted Answer

The NumOutputs property is a documented property of custom layers as of release R2019a. The online documentation is for the most recent release, which is currently release R2019a. You're using an older release.

6 Comments

I am running MatLab R2019a. I get the following typing 'ver' in the Command Window:
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.6.0.1072779 (R2019a)
MATLAB License Number: <removed>
Operating System: Mac OS X Version: 10.12.6 Build: 16G1314
Java Version: Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.6 (R2019a)
Simulink Version 9.3 (R2019a)
Audio Toolbox Version 2.0 (R2019a)
Computer Vision Toolbox Version 9.0 (R2019a)
Control System Toolbox Version 10.6 (R2019a)
DSP System Toolbox Version 9.8 (R2019a)
Deep Learning Toolbox Version 12.1 (R2019a)
Image Processing Toolbox Version 10.4 (R2019a)
Instrument Control Toolbox Version 4.0 (R2019a)
Optimization Toolbox Version 8.3 (R2019a)
Signal Processing Toolbox Version 8.2 (R2019a)
Simulink Control Design Version 5.3 (R2019a)
Statistics and Machine Learning Toolbox Version 11.5 (R2019a)
Symbolic Math Toolbox Version 8.3 (R2019a)
>>
[SL: edited to remove license number]
I have just made a clean install of MatLab R2019a and the error still persists.
I don't think the layers you're using, sequenceFoldingLayer and sequenceUnfoldingLayer, are custom layers. I could be wrong but my understanding, based on the documentation pages, is that the only property of those layers you can modify is Name.
Yes, I see. That could be the issue. Though, I do not understand why the properties 'NumOutputs' and 'NumInputs' in the folding and unfolding layers respectively, are listed as properties that can be modified.
Thank you for your answer. I will try to use custom layers instead.
Those layers have those properties, but I suspect they're read-only for those particular layers.
I finally found a solution. My problem was that I did not understand the documentation for the sequenceFolding and sequenceUnfolding layers, and missed a small, but very important fact, to use the connectLayers function to make the connection between the folding layers miniBatchSize output to the unfolding layers miniBatchSize input. The fact was hidden (in plain sight) in one line of text in the middle of an example.
I accept this answer because it lead me on the right way to understand.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 28 Mar 2019

Edited:

on 1 Apr 2019

Community Treasure Hunt

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

Start Hunting!