2017-03-22 1 views
0

私はhttps://arxiv.org/abs/1610.01683で説明されている畳み込みネットワークを再現しようとしています。そのセットアップのmatlabで層のサイズを取得するCNN

概要:

enter image description here

しかし、私は別のフィルタからの結果を結合しようとすると、障害物に遭遇しているようです。 この論文では、20種類のフィルタリングされた1D信号が積み重ねられて一種のスペクトログラムが作成され、別の畳み込みレイヤーに供給される「スタッキング」レイヤーが作成されています。どのように1つは、MATLABで同様のことをするのですか?以下は、私が試したものである、と私は取得エラーメッセージ:

入力:

inputLayer=imageInputLayer([1 6000]); 
    c1=convolution2dLayer([1 200],20,'stride',1); 
    p1=maxPooling2dLayer([1 20],'stride',10); 
    c2=convolution2dLayer([20 30],400,'numChannels',20); 
    p2=maxPooling2dLayer([1 10],'stride',[1 2]); 
    f1=fullyConnectedLayer(500); 
    f2=fullyConnectedLayer(500); 
    s1=softmaxLayer; 
    outputLayer=classificationLayer; 

    convnet=[inputLayer; c1; p1; c2; p2; f1; f2; s1;outputLayer] 

    opts = trainingOptions('sgdm'); 
    convnet = trainNetwork(allData',labels,convnet,opts); 

出力:

convnet = 

    9x1 Layer array with layers: 

     1 '' Image Input    1x6000x1 images with 'zerocenter' normalization 
     2 '' Convolution    20 1x200 convolutions with stride [1 1] and padding [0 0] 
     3 '' Max Pooling    1x20 max pooling with stride [10 10] and padding [0 0] 
     4 '' Convolution    400 20x30 convolutions with stride [1 1] and padding [0 0] 
     5 '' Max Pooling    1x10 max pooling with stride [1 2] and padding [0 0] 
     6 '' Fully Connected   500 fully connected layer 
     7 '' Fully Connected   500 fully connected layer 
     8 '' Softmax     softmax 
     9 '' Classification Output cross-entropy 
    Error using nnet.cnn.layer.Layer>iInferSize (line 261) 
    Layer 5 is expected to have a different size. 

    Error in nnet.cnn.layer.Layer.inferParameters (line 53) 
        layers = iInferSize(layers, i, inputSize); 

    Error in trainNetwork (line 61) 
    layers = nnet.cnn.layer.Layer.inferParameters(layers); 

エラーメッセージが層5のためですが、私はそれが持っている疑いがあります「スタッキング」が行われるレイヤー4と関係がある。 考えますか?

答えて

0

ここでの基本的な問題は、convolution2dLayerが1D入力を理解していないことです。根深い詳細に入ることで、入力が非常に迅速に無意味になることが分かりました(例えば、負の数の行)。

関連する問題