main_incal_vs_remnenmf.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. clear
  2. close all
  3. clc
  4. %% Adding every files in the path
  5. addpath(genpath(pwd))
  6. %% Simulation parameters
  7. s_width = 50; % Scene width
  8. s_length = 50; % Scene length
  9. N_Ref = 4; % Nb. of reference measurements
  10. N_Cpt = 100; % Nb. of mobile sensors
  11. Mu_beta = .9; % Mean sensors gain
  12. Mu_alpha = 5; % Mean sensors offset
  13. Bound_beta = [.01;1.5]; % Gain boundaries
  14. Bound_alpha = [3.5;6.5]; % Offset boundaries
  15. MV = .9; % Missing Value prop.
  16. RV = 0.3; % RendezVous prop.
  17. var_n = 0; % Noise variance
  18. M_loop = 50; % Number of M loop per E step
  19. runs = 1; % Total number of runs
  20. %% Nesterov parameters
  21. InnerMinIter = 5;
  22. InnerMaxIter = 20;
  23. Tmax = 300;
  24. %% Compression parameters
  25. nu = 10;
  26. %%
  27. delta_measure = 1;
  28. iter_max = round(Tmax / delta_measure);
  29. %% Allocation for the RMSE values
  30. % remnenmf
  31. RMSE_offset_remnenmf = nan(runs, iter_max);
  32. RMSE_gain_remnenmf = nan(runs, iter_max);
  33. % Incal
  34. RMSE_offset_incal = nan(runs, iter_max);
  35. RMSE_gain_incal = nan(runs, iter_max);
  36. for run = 1:runs
  37. % data generation
  38. [X, X_theo, W, F_theo, Omega_G, Omega_F, Phi_G, Phi_F, Ginit, Finit] = data_gen(s_width, s_length, run, N_Ref, N_Cpt, Mu_beta, Mu_alpha, Bound_beta, Bound_alpha, MV, RV, var_n);
  39. seed = floor(rand*10000);
  40. % remnenmf
  41. rng(seed)
  42. [T_remnenmf, RMSE] = remnenmf_not_full( W , X , Ginit , Finit, Omega_G, Omega_F, Phi_G, Phi_F , InnerMinIter , InnerMaxIter , Tmax , M_loop, F_theo, delta_measure, nu);
  43. RMSE_offset_remnenmf(run,:) = RMSE(1,:);
  44. RMSE_gain_remnenmf(run,:) = RMSE(2,:);
  45. % incal
  46. rng(seed)
  47. [T_incal, RMSE] = IN_Cal( W , X , Ginit , Finit , Omega_G , Omega_F , Phi_G , Phi_F , F_theo , Tmax, delta_measure );
  48. RMSE_offset_incal(run,:) = RMSE(1,:);
  49. RMSE_gain_incal(run,:) = RMSE(2,:);
  50. end
  51. % remnenmf
  52. min_offset_remnenmf = min(RMSE_offset_remnenmf,[],1,'omitnan');
  53. med_offset_remnenmf = median(RMSE_offset_remnenmf,1,'omitnan');
  54. max_offset_remnenmf = max(RMSE_offset_remnenmf,[],1,'omitnan');
  55. min_gain_remnenmf = min(RMSE_gain_remnenmf,[],1,'omitnan');
  56. med_gain_remnenmf = median(RMSE_gain_remnenmf,1,'omitnan');
  57. max_gain_remnenmf = max(RMSE_gain_remnenmf,[],1,'omitnan');
  58. subplot(121)
  59. semilogy(T_remnenmf,min_offset_remnenmf,'b')
  60. hold on
  61. semilogy(T_remnenmf,med_offset_remnenmf,'b')
  62. o_e = semilogy(T_remnenmf,max_offset_remnenmf,'b');
  63. hold off
  64. subplot(122)
  65. semilogy(T_remnenmf,min_gain_remnenmf,'b')
  66. hold on
  67. semilogy(T_remnenmf,med_gain_remnenmf,'b')
  68. g_e = semilogy(T_remnenmf,max_gain_remnenmf,'b');
  69. hold off
  70. % incal
  71. min_offset_incal = min(RMSE_offset_incal,[],1,'omitnan');
  72. med_offset_incal = median(RMSE_offset_incal,1,'omitnan');
  73. max_offset_incal = max(RMSE_offset_incal,[],1,'omitnan');
  74. min_gain_incal = min(RMSE_gain_incal,[],1,'omitnan');
  75. med_gain_incal = median(RMSE_gain_incal,1,'omitnan');
  76. max_gain_incal = max(RMSE_gain_incal,[],1,'omitnan');
  77. subplot(121)
  78. hold on
  79. semilogy(T_incal,min_offset_incal,'r')
  80. semilogy(T_incal,med_offset_incal,'r')
  81. o_i = semilogy(T_incal,max_offset_incal,'r');
  82. hold off
  83. subplot(122)
  84. hold on
  85. semilogy(T_incal,min_gain_incal,'r')
  86. semilogy(T_incal,med_gain_incal,'r')
  87. g_i = semilogy(T_incal,max_gain_incal,'r');
  88. hold off
  89. % adding title and labels
  90. subplot(121)
  91. title('RMSE offset')
  92. legend([o_e o_i],'REMNeNMF','IN\_Cal')
  93. subplot(122)
  94. title('RMSE gain')
  95. legend([g_e g_i],'REMNeNMF','IN\_Cal')