Apply CNN to matrices (table of same #columns but of different #rows)

I know that CNN can deal with images, say training examples with (m, 64,64,3) shape, m being the number of examples, 64x64 being width x height, 3 being the channel if RGB. I wonder what if I’ve got a bunch of matrices of numbers, but these matrices are of different rows (though same number of columns), I know that we can sort of pre-process images in order to make different images to be of the same width x height (say python image modules), but what about preprocessing those matrices that I’ve mentioned? Do have have any ways to deal with them properly in order to make a relatively regular shaped input feature? say (m_train, row, col).

Now what’s on my mind is that I wanna see these matrices of different rows as an image, since images are merely matrices of pixels, and since we can make do with images input data (cropping or disproportionally shrinking or enlarging…), can we do the same with those matrices of different #rows? Just a thought. Many thanks if anyone can help me!

All of the input data to a model should be the same size.

One way to handle this is to center the smaller matrix, and add padding around the edges (extra rows or columns of zeros) as necessary to increase its size.

2 Likes

tahnks