フィルターのクリア

how to compress a variable size matrix into a fixed size one?

1 回表示 (過去 30 日間)
Vidhya Dharshini
Vidhya Dharshini 2013 年 9 月 26 日
コメント済み: Vidhya Dharshini 2013 年 9 月 27 日
i need a function to convert variable size matrices into a fixed size of 25*25.

回答 (2 件)

ES
ES 2013 年 9 月 26 日
You want to truncate first 25 rows and columns?
[m,n]=size(VariableSizeMatrix)
if (m>=25 && n>=25)
FixedSizeMatrix=VariableSizeMatrix(1:25,1:25)
end
if the size of VariableSizeMatrix is less than (25, 25) pad zeros or process according to your needs.

Jan
Jan 2013 年 9 月 26 日
It depends on what kind of compression you want. It could be cutting out a part on the top or bottom, right, left or from the center. You could mean a linear or cubic interpolation, or a Lanzcos resampling using imresize.
  5 件のコメント
Walter Roberson
Walter Roberson 2013 年 9 月 27 日
You cannot fit all unique 1*700 vectors into 25*25 without data loss, but if there are at least 75 duplicates you could do it.
What you probably want is something like to extract "features" from the sentences, in such a way that the 700 different sentences reduced down to a 25*25 matrix, with the mapping being by some kind of "essential similarity", with the NN so produced able to classify other sentences according to their essential similarities.
For example, if you were to classify each word independently by the possible parts of speech the word could be, then instead of the actual words, you could record the allowed parts of speech in sequence, and train the NN on those sequences. The resulting training should be able to predict what the actual parts of speech were for each word, because the same patterns occur repeatedly. You might find, for example, that ADJECTIVE-NOUN-NOUN seldom occurs, and so could deduce that the ADJECTIVE-(NOUN or ADJECTIVE)-NOUN pattern "big red box" is likely the ADJECTIVE-ADJECTIVE-NOUN pattern that occurs more often. Such as in the pattern "big heavy box".
Vidhya Dharshini
Vidhya Dharshini 2013 年 9 月 27 日
thank u sir......this is what i wanted....thank u so much....

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by