MATLAB Answers

Classifying matrices with neural networks

5 views (last 30 days)
Denis Svechkarev
Denis Svechkarev on 29 Jul 2021
Commented: Denis Svechkarev on 12 Aug 2021
There is an excellent tutorial on simple NN training using images (https://www.mathworks.com/help/deeplearning/ug/create-simple-deep-learning-network-for-classification.html) - but can I do the same thing using matrices? Or does the method only support image files as the input format? If so - how can I modify it to be able to have data files (basically text files containing simple matrices (3D spectra)) as an input for the classifier? Thank you in advance for any suggestions!

Answers (1)

Sahil Jain
Sahil Jain on 11 Aug 2021
MATLAB provides multiple datastore classes to train neural networks on different types of data. For example, the tutorial that you mentioned uses the imageDatastoreclass for reading image data. You can go through the Getting Started With Datastore article to see if your data files fall under any of the supported formats and use the corresponding datastore class. In case your data does not fall under any the formats mentioned in the above article, you can create a custom datastore for your own data, as described in the Develop Custom Datastore article.
  1 Comment
Denis Svechkarev
Denis Svechkarev on 12 Aug 2021
Thank you for the pointer! I took a look at the existing datastore classe, and the tabularTextDatastore looks the best for handling the data files that contain matrices (in a tabulat format). However, it appears to lack the LabelSource parameter that is necessary for automatically labeling the data based on their respective folders. How do I sort my data into different classes with this datastore class?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!