Converting 4D matrix to 2D

조회 수: 2 (최근 30일)
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman 2017년 11월 28일
댓글: Sivaramakrishnan Rajaraman 2017년 11월 28일
I'm extracting features from pre-trained CNNs. The size of the extracted feature matrix is in 4-D. The extracted features are then used to train a linear classifier. The extracted features have dimensions (1,1,1024,200) (in general m,n,p,q) where 1024 is the dimension of the features and 200 is the number of images. I'd like to extract only the p and q components,leaving behind the first and second dimensions. I tried to use Squeeze function but it doesn't help. Kindly help me with the syntax to obtain only the 2-dimensions (i.e.)(1024,200).
  댓글 수: 2
Matt J
Matt J 2017년 11월 28일
Try the squeeze function again. There's no reason it shouldn't have worked.
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman 2017년 11월 28일
The squeeze function works only at the 'avg_pool' layer, just before the softmax. It doesn't show any error when applied to the earlier layers, however, the dimensions remain unchanged. ResNet50 is a DAG network. Does that have anything to do with restricting the usage of Squeeze in the earlier layers?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by