featureinputlayer and convolution1dlayer

featureinputlayer matches fullyconnectedlayer but not matches convolution1dlayer

Antworten (1)

yanqi liu
yanqi liu am 21 Mär. 2022

0 Stimmen

layers = [
featureInputLayer(100,'Name','input')
fullyConnectedLayer(5, 'Name','fc')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')]
layers =
4×1 Layer array with layers: 1 'input' Feature Input 100 features 2 'fc' Fully Connected 5 fully connected layer 3 'sm' Softmax softmax 4 'classification' Classification Output crossentropyex
layers2 = [
featureInputLayer(100,'Name','input')
convolution1dLayer(50, 3,'Stride',1, 'Name','cnn1d')
fullyConnectedLayer(5, 'Name','fc')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')]
layers2 =
5×1 Layer array with layers: 1 'input' Feature Input 100 features 2 'cnn1d' Convolution 3 50 convolutions with stride 1 and padding [0 0] 3 'fc' Fully Connected 5 fully connected layer 4 'sm' Softmax softmax 5 'classification' Classification Output crossentropyex

4 Kommentare

san su
san su am 22 Mär. 2022
Thank you for your answer. Many thanks.
My friend run your code, and add "analyzeNetwork(layers2)". There still exist one error.
layers2 = [
featureInputLayer(100,'Name','input')
convolution1dLayer(50, 3,'Stride',1, 'Name','cnn1d')
fullyConnectedLayer(5, 'Name','fc')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')];
analyzeNetwork(layers2)
(非常感谢回答!我朋友跑了下这段程序,添加了analyzeNetwork(layers2),还是报错。见图片。他用featureInputLayer和convolution1dLayer的时候就是这样报错。当时是将多个通道合并,matlab不能合并多个sequenceinputlayer,只能用featureInputLayer。报错显示合并后的维度不满足convolution1dLayer对维度的要求。感觉用的挺别扭。)
yanqi liu
yanqi liu am 22 Mär. 2022
您好,方便的话可以发一下mat数据,有时候网络提示异常不影响训练
san su
san su am 22 Mär. 2022
Bearbeitet: san su am 22 Mär. 2022
您好!matlab这个数据要通过arrayDatastore和combine处理下才能训练,也不太好发数据。后来用imageinputlayer代替了featureinputlayer就解决了,不过想要在fullyconnectedlayer后面接convolution1dlayer是不行的。和上面图中的报错一样,程序根本不走。
yanqi liu
yanqi liu am 22 Mär. 2022
是的,如果是做分类,则一般fullyconnectedlayer全连接后就要进入classify了,卷积层一般在中间

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 20 Mär. 2022

Kommentiert:

am 22 Mär. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by