How to input 2D array data for Deep learing toolbox model, not image file

I want to perform classification using 2D data as input in MATLAB using the Deep Learning Toolbox.
I have 2D-1ch and 2D-3ch data, and I want to know how to input this data into the Deep Learning Toolbox.
Currently, the data is in CSV format, but I can convert it into a suitable 2D array.
However, when I try to input the data in the imds format like the toolbox examples (imdsTrain, imdsValidation), I encounter an error when using @readDatastoreImage since it cannot read CSV files.
  1. How can I read the input data in a format suitable for the toolbox? (I get an error when executing net = trainNetwork(imdsTrain, layers, options);)
  2. I want to define layers directly and convert the data into a format that can be used with imageInputLayer to train the model using the trainNetwork function.
  3. I would appreciate it if you could provide other alternative methods to perform classification on 2D arrays.
I would appreciate specific answers. Thank you.

回答 (1 件)

Matt J
Matt J 2023 年 7 月 20 日
編集済み: Matt J 2023 年 7 月 20 日

0 投票

Currently, the data is in CSV format, but I can convert it into a suitable 2D array.
An imageDataStore has a ReadFcn property that you can set to enable it to read in from arbitrary file formats.

5 件のコメント

Yongwon Jang
Yongwon Jang 2023 年 7 月 21 日
編集済み: Yongwon Jang 2023 年 7 月 21 日
First, thank you for your answer.
Yes, exactly. the @readDatastoreImage Fcn... that is dedicated to image file format.
Several years ago, I used MatConvNet and I handled 2D array at that time.
These days, mathworks provides deep learning toolbox but I cannot and I don't want edit intricsic functions. (Actually no time for editing the function in detail..)
I believe the beautifull picture is.... To use toolbox the most, and input file could be fit for that.
If possible, can you help me to make arbitrary read function?
Matt J
Matt J 2023 年 7 月 21 日
If possible, can you help me to make arbitrary read function?
You said that you already had code to read the data into a 2D array. I was trying to imply that you should use that.
Yongwon Jang
Yongwon Jang 2023 年 7 月 27 日
I changed the input format 4-d array, and tried to trainNetwork.
The solution is.. .Not using imds !!
I cound not find the way to use @readDatastoreImage Fcn.
Matt J
Matt J 2023 年 7 月 27 日
Well, if it allows you to move on with your life, I guess that's the important thing, but I don't think it's a real solution.
Yongwon Jang
Yongwon Jang 2023 年 7 月 28 日
編集済み: Yongwon Jang 2023 年 7 月 28 日
Thank you for your comments.
However, this solution was provided by one of the matlab staff.......
I'll try that some other time. There are a lot of other issues that need to be addressed right now...

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

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

製品

リリース

R2023a

質問済み:

2023 年 7 月 20 日

編集済み:

2023 年 7 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by