Custom filedatastore for deep learning

3 ビュー (過去 30 日間)
Bence Cserkuti
Bence Cserkuti 2020 年 11 月 17 日
回答済み: Bence Cserkuti 2020 年 11 月 27 日
I started to implement a Deep Learning network to classify the modulation of RF signals.
I use a 2D image input layer with dimensions 1x1024x2. I converted the dataset into variables which are saved in mat files. The variables have a dimension of 1x1024x2xN, where N is the number of signals which is 24*4096. The labels are stored in separate mat files and the variable is an Nx1 categorical cell array.
I have multiple mat files for the training data but I am unable to create a filedatastore which will read all of the signals along the 4th dimension from one file and then do the same for the rest of the files.

採用された回答

Bence Cserkuti
Bence Cserkuti 2020 年 11 月 27 日
Thank Mahesh,
I ended up writing a custom Datastore class. In case others face the same problem, I recommend reading these pages carefully:
In my case, when I initialise my custom class, I pass two arguments: the file names of my signals and the file names of the corresponding labels. I then create a filedatastore for each dataset. What was a key observation is that your custom read function must return 1 observation at a time by default (this can be increased by implementing the ReadSize property). In this case that means then if I call ds.preview it will return a row that contains a 1x1024x2 signal and the corresponding categorical array.

その他の回答 (1 件)

Mahesh Taparia
Mahesh Taparia 2020 年 11 月 21 日
Hi
In this case, you can create a custom ReadFcn while creating a file datastore. For more information, you can refer this documentation. The custom read function will load the file and read the data as per required.Hope it will help!
  1 件のコメント
Bence Cserkuti
Bence Cserkuti 2020 年 11 月 27 日
Thank Mahesh,
I ended up writing a custom Datastore class. In case others face the same problem, I recommend reading these pages carefully:
In my case, when I initialise my custom class, I pass two arguments: the file names of my signals and the file names of the corresponding labels. I then create a filedatastore for each dataset. What was a key observation is that your custom read function must return 1 observation at a time by default (this can be increased by implementing the ReadSize property). In this case that means then if I call ds.preview it will return a row that contains a 1x1024x2 signal and the corresponding categorical array.

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

カテゴリ

Help Center および File ExchangeClassification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by