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.

DumpTime2.m 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. clear;
  2. clc;
  3. dataDir = 'SteamExp1/results_1a/';
  4. files = dir(strcat(dataDir, 'res_Steam*.mat'));
  5. dateNow = clock;
  6. dateNow = strcat(num2str(dateNow(1)),'_',num2str(dateNow(2)),'_', num2str(dateNow(3)),'_', num2str(dateNow(4)), num2str(dateNow(5)),'_', num2str(dateNow(6)));
  7. outFile = sprintf('%sDumpTimes_%s.txt',dataDir, dateNow);
  8. fileID = fopen(outFile,'w');
  9. first = 1;
  10. time1=0;
  11. time2=0;
  12. for f = files'
  13. data = load(strcat(dataDir,f.name));
  14. numResults = size(data.purity,2);
  15. numMissing = size(data.removed_nodes,2);
  16. line = numResults/numMissing;
  17. % print header
  18. if first == 1
  19. fprintf(fileID,'\tfile\tinx\titer\tnodes\tedges\tattEdges\tattNodes\tmissInx\tmissNum\tnumPHs\tavgPHs');
  20. for i=1:line
  21. r=data.purity(1,i);
  22. if r.withAttr == 1
  23. fprintf(fileID,'\tAtt %d\tDiff %d',r.affinity_calculation_type,r.affinity_calculation_type);
  24. else
  25. fprintf(fileID,'\tAlg %d',r.affinity_calculation_type);
  26. end
  27. end
  28. fprintf(fileID,'\n');
  29. first = 0;
  30. end
  31. %print data
  32. for i=1:numResults
  33. r = data.purity(1,i);
  34. if mod(i,line)==1
  35. fprintf(fileID,'\t%s',data.file);
  36. fprintf(fileID,'\t%d',data.i);
  37. fprintf(fileID,'\t%d',data.iter);
  38. fprintf(fileID,'\t%d',r.graph_size);
  39. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  40. fprintf(fileID,'\t%d',r.graph_attr_edges); % 12.12.12
  41. fprintf(fileID,'\t%d', data.purity(1,i+1).num_attr_nodes);
  42. fprintf(fileID,'\t%d',r.num_missing_nodes_idx);
  43. fprintf(fileID,'\t%d',r.num_missing_nodes);
  44. fprintf(fileID,'\t%d',r.num_placeholders);
  45. fprintf(fileID,'\t%d',r.num_placeholders/r.num_missing_nodes);
  46. end
  47. if mod(i,2)==1
  48. time1 = r.affinity_calc_time + r.reduce_dim_time + r.graph_predict_time;
  49. fprintf(fileID,'\t%d',time1);
  50. elseif mod(i,2)==0
  51. time2 = r.affinity_calc_time + r.reduce_dim_time + r.graph_predict_time;
  52. fprintf(fileID,'\t%d',time2);
  53. fprintf(fileID,'\t%d',time1-time2);
  54. end
  55. if mod(i,line)==0
  56. fprintf(fileID,'\n');
  57. end
  58. end
  59. end
  60. fclose(fileID);
  61. LogMsg(sprintf('Completed DumpResults at%s',outFile));