Clear Filters
Clear Filters

Can i use convolution2dLayer only when the input is an image?

5 views (last 30 days)
I have a series of .csv files that i've gathered in a data store with the object "tabularTextDatastore". Each .csv file contains a 4x4 matrix of complex numbers.
Now i want to create my convolutional neural network. I have 2 questions:
1) As first layer of my network i should use "featureInputLayer" because I'm working with a data set of numeric scalars. But i want to apply a "convolution2dLayer" as second layer to my 4x4 matrix, so should i still use "featureInputLayer" or can i use "imageInputLayer" for my first network's layer?
2) Does "convolution2dLayer" operates only on images? If the answer is yes, how can i realize a 2d convolution on a matrix of numeric scalars?
Thank you for the answers.

Answers (1)

Walter Roberson
Walter Roberson on 16 May 2023
Does "convolution2dLayer" operates only on images?
No. By the time the network gets the data to process, all it is getting is the values (and perhaps class information); absolutely nothing gets passed in along the lines of "This data was extracted from a file by imread or video device reader." Just an array of the appropriate dimension. The convolution layer has no possible way to tell if the data came from an image or from a run of Conway's "Game of Life" or something else.
Feel free to use the layer in any situation where you have a 2d array of data that is spatially correlated.

Community Treasure Hunt

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

Start Hunting!