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.
- 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);)
- 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.
- 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 个)
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
2023-7-21
编辑:Yongwon Jang
2023-7-21
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
2023-7-27
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
2023-7-28
编辑:Yongwon Jang
2023-7-28
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!