How do I import 4D array input data(X_train and Y_train) into Deep network designer.

Hi, I am doing the signal denoising using CNN and it is a regression problem... And I have converted my 1D signal data into 4D array..
I have been successfully run my CNN network using 4D array input data(X_train and Y_train) in matlab code...
But when I tried to implement CNN network in deep network designer, it was asking to use combine datastore...
So I was using the combine function to combine the X_train adn Y_train into a single datastore.. ds = combine(XTrain,YTrain); Not working...It said "Check for incorrect argument data type or missing argument in call to function 'combine'."
How do I import 4D array input data(X_train and Y_train) into Deep network designer?
Please help me, thank you...

 Akzeptierte Antwort

First you have to convert your array data to datastores using arrayDatastore as follows:
adsXTrain = arrayDatastore(X_train);
adsYTrain = arrayDatastore(Y_train);
Then combine the above datastores using combine method:
cdsTrain = combine(adsXTrain,adsYTrain);
Now you will have the option to select either of the above datastores in the Deep Network Designer App.

5 Kommentare

Thank you for answer, but i still have problem...My XTrain data has dimension of 3000x1x1x20. When I import it to the deep network designer app, the data becomes to 1x1x1x20. Do you know why? My input image layer has size of 3000x1x1x20. The data works under code, but does not work under Deep network designer app...
In case the batch dimension or the iteration dimension of the data is not 1, then you will have to specify the corresponding dimension while creating the arrayDatastore.
For example, if the dimension of my Xtrain is 10x3000x1x1x20, then with IterationDimension = 1 it means that I am considering the 1st dimension whose size is 10 as my batch (or iterating) dimension and 3000x1x1x20 as the inputSize to the input layer.
For more information, refer to IterationDimension.
Sorry for mention the wrong information. My input image layer has size of 3000x1x1. Not 3000x1x1x20.... What will happen in the case of 3000x1x1
In that case create the arrayDatastore as follows:
adsXTrain = arrayDatastore(X_train,IterationDimension=4)
assuming that the size of X_train is 3000x1x1x20.
Also, I think in this scenario you can probably use featureInputLayer instead of imageInputLayer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Produkte

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by