Deep learning: how to labels data using a datastore?
    9 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hello,
I have some data (close to 500 *.mat files, size 3620x1, corresponding to measured signals) which are classified into two folders. Folder names represent the status of the data. I would like to perfom some deep learning on it: to do this, I tried to create a datastore using fileDatastore, but I don't know how to label all data with the folder name. Is it any possibility? 
I know I can add 'LabelSource' using imageDatastore, but the Deep Network Designer did not work with such a datastore with *.mat files inside... Is anybody faced this issue?
0 件のコメント
回答 (1 件)
  Ganapathi Subramanian R
      
 2023 年 10 月 4 日
        Hi Arnaud, 
                I understand that you are working on Deep Learning project and have an issue in labelling data using a datastore. Please provide the ‘FileExtensions’ and ‘ReadFcn’ Name-Value pairs in the ‘imageDatastore’ function to specify that the files are ‘.mat’ files and provide a custom function that can extract the matrix from each MAT-file. 
dataPath = fullfile('data'); 
imds = imageDatastore(dataPath, ... 
    'IncludeSubfolders',true,'LabelSource','foldernames','FileExtensions',{'.mat'},'ReadFcn',@my_read_fcn); 
function res = my_read_fcn(f) 
s = load(f); 
res = s.NameOfMatrixVariable; 
end 
Please refer the below documentation for further information regarding ‘imageDatastore’ function. 
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で AI for Signals についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

