How to use a sequenceInputLayer with a regressionLayer (neural networks) ?

Hi everyone,
How is it possible to use a sequenceInputLayer with a regressionLayer (neural networks)? I have tried the following code:
layers = [...
sequenceInputLayer(inputSize)
fullyConnectedLayer(30)
fullyConnectedLayer(1)
regressionLayer]
which results with the following error message:
Error using trainNetwork (line 140)
The output of layer 3 is incompatible with the input expected by layer 4.
I searched through the manual and have yet to find something that pertains to the expected input of a regressionLayer.
If someone happens to be able to share the relevant documentation or a snippet of code, that would be really helpful.
Thank you very much!

2 件のコメント

bjmuld
bjmuld 2017 年 10 月 11 日
same question here. commenting so I get notified.
Omer Sholev
Omer Sholev 2018 年 6 月 12 日
same here, stuck on this Did you find a solution?

サインインしてコメントする。

回答 (2 件)

Greg Heath
Greg Heath 2017 年 10 月 12 日

0 投票

The regression layer is the only one that has no explicit indication of size.
Hope this helps.
Greg

2 件のコメント

Omer Sholev
Omer Sholev 2018 年 6 月 12 日
So what should we do? thanks
Guy Schofield
Guy Schofield 2019 年 4 月 4 日
Can you put an example code for the solution?
Thanks

サインインしてコメントする。

Greg Heath
Greg Heath 2019 年 4 月 4 日

0 投票

The answer is obvious:
help regressionlayer
doc regressionlayer
*Thank you for formally accepting my answer*
Greg

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2017 年 10 月 5 日

回答済み:

2019 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by