How to reuse activations of two concatenated layers into a new one

조회 수: 2 (최근 30일)
Ben Hur
Ben Hur 2017년 11월 15일
댓글: Kenta 2020년 3월 29일
I have two streams pre-trained networks (alexnet), I got the activations from the conv5 layer (for the two stream), then, concatenate the training feature for each stream and also the testing features as a mat file. the dimension of the output of the conv5 is 18462x43682 which will be 18462x87364.
Now I just want to feed the concatenated features into new layers ending with fully connected and classification layer.
1- should I use a new network and feed the concatenated features as an input. or using one of the old networks? 2- how to get the activations which have huge dimension after concatenation to the next layer?
Many Thanks
  댓글 수: 7
Meiyan Huang
Meiyan Huang 2018년 3월 5일
I have the same problem. Do you solve it? If so, could you please tell me? Many thanks!

댓글을 달려면 로그인하십시오.

채택된 답변

Bernhard Suhm
Bernhard Suhm 2018년 1월 10일
1) If you have R2017b, there is support for DAG networks. You'd extract the layers from the networks using the “Layers” property. Then you would created a “LayerGraph” object using the “layerGraph” function, add the layers with the “addLayers” function, and use “connectLayers” to add any new connections.
2) To clarify, are the dimensions of 18462x87364 the output of “activations”. In 2017b and earlier, the default output of activations is NumObs-by-featureDims. This implies that 18,462 is the number of observations. So if you create a DAGNetwork like described above, you can reduce ‘MiniBatchSize’ to split those 18,462 observations into a series of batches that will be processed one by one to keep memory usage low. Let me know if that assumption wasn't correct.
Yes, looks like you are out of software maintenance (account "off" in your terms), or else tech support would have picked up your question a long time ago. If you are current on your maintenance, reach out to tech support to validate that you are eligible for support, and ask your questions that way. This forum is not watched closely - I am making an attempt to catch up, but there is no guarantee for fast turn around on MATLAB answers.
  댓글 수: 1
Meiyan Huang
Meiyan Huang 2018년 3월 5일
I followed the suggestions as you mentioned above. However, there was something wrong when I connected multi-inputs into the network (two sets of data for two streams pre-trained alexnet respectively, then concatenate the training feature for each stream). There were "Layer graphs can contain only one input layer." appeared on the Matlab. Could you please tell me how to add multi-inputs into the network? Many thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by