You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PrepareDataset.m~ 1.1KB

5 years ago
123456789101112131415161718192021222324252627282930313233
  1. clear;
  2. clc;
  3. datasetDir = '/Users/armin/Desktop/DML/graph\\ gen\\ proj/VotingDatasets_Nov15/Steam/FF60a_Steam_GM2_GR2_60/';
  4. filePrefix = 'Steam_';
  5. %netSizes = [2048 4096 5000 8192 16384 20000 25000 32768]; % 50000 75000 100000];
  6. netSizes = [50000 75000]; %[2048 4096 8192 16384 32768]; % 10000 25000 50000 75000 100000];
  7. debug = 0;
  8. % convert ascii graph to .mat data graph
  9. fprintf('Start prepareDataSet ...\n');
  10. for nodes = netSizes
  11. prefix = sprintf('%s%s%d_%s',datasetDir,filePrefix,nodes,'*.txt');
  12. fprintf(prefix)
  13. files = [dir(prefix)];
  14. for i = 1:size(files,1)
  15. file = files(i).name;
  16. fprintf('SALAM')
  17. usrFile = strfind(file, '.usr');
  18. matFile = strfind(file, '.mat');
  19. if isempty(usrFile) && isempty(matFile)
  20. fprintf('dataSet %s ...\n',file);
  21. [data] = LoadAsciiGraph(datasetDir, file, nodes, debug);
  22. %[edges] = SaveAsciiGraph(strcat(datasetDir,testDir), file, data);
  23. fprintf('SALAM')
  24. save(strcat(datasetDir,'matFormat/',file,'.mat'), 'data');
  25. end
  26. end
  27. fprintf('Completed Run.\n');
  28. end