www.pudn.com > RobustSF.zip > testSF.m, change:2014-07-16,size:3327b


 
downsample=3; 
nround=3; 
SF_S_acc=zeros(nround,1); 
SF_W_acc=zeros(nround,1); 
SF_acc=zeros(nround,1); 
RobustLatLRRZ_acc=zeros(nround,1); 
RobustLatLRRLX_acc =zeros(nround,1); 
pa=[0.028,0.03,0.032,0.034,0.036]; 
nround=length(pa); 
for i=1:nround 
%  path=fullfile('E:\算法代码\实验AR - 统计时间-ourmethod',sprintf('Data_Mixed_downsample%d',downsample),num2str(i)); 
% %     path=fullfile('E:\算法代码\实验AR - 统计时间-ourmethod',sprintf('Data_Scraf_downsample%d',downsample),num2str(i)); 
% %     path=fullfile('E:\算法代码\实验AR - 统计时间-ourmethod',sprintf('Data_sumglass_downsample%d',downsample),num2str(i)); 
%    load(fullfile(path,'ts_label.mat')); 
%    load(fullfile(path,'tr_label.mat')); 
%    load(fullfile(path,'X1.mat')); 
%    load(fullfile(path,'X2.mat')); 
 
    
%% 未归一化 
   tic; 
  [U_hat, Sigma_hat, V_hat, ~, ~, ~] = inexact_alm_rpca(X1,pa(i), 1e-4, 400); 
  lambda=1e-4; 
  [UP,G,W] = compute_projection_matrix_and_classifier_parameters( U_hat,Sigma_hat,V_hat,tr_label,lambda); 
   train_time=toc; 
    
   tic; 
   Z2=U_hat*(U_hat'*X2); 
   Z2=UP*diag(G)*(UP'*Z2); 
   [acc] = predic_labels( Z2,ts_label,W); 
   test_time=toc; 
    
   
   fprintf('未归一化:acc \t training time \t testing time\n'); 
   fprintf('         %f   \t  %f          \t %f      \n',acc,train_time,test_time); 
   [SF_S_acc(i)] = HH( U_hat,Sigma_hat,V_hat,X2,tr_label,ts_label,1e-4); 
    
%% 归一化 
  tic; 
%   [U_hat, Sigma_hat, V_hat, ~, ~, ~] = inexact_alm_rpca(X1,0.032, 1e-4, 400); 
  lambda=1e-4; 
  [UP,G] = compute_projection_matrix( U_hat,Sigma_hat,V_hat,tr_label,lambda); 
  Z1=U_hat*Sigma_hat*V_hat'; 
  Z1=UP*diag(G)*(UP'*Z1); 
  Z1= NormalizeFea(Z1,0); 
  W = compute_classifier_parametrs( Z1,tr_label); 
  train_time=toc; 
   
  tic; 
  Z2=U_hat*(U_hat'*X2); 
  Z2=UP*diag(G)*(UP'*Z2); 
  Z2= NormalizeFea(Z2,0); 
  [acc] = predic_labels( Z2,ts_label,W); 
  test_time=toc; 
  
   fprintf('归一化:acc \t training time \t testing time\n'); 
   fprintf('         %f   \t  %f          \t %f      \n',acc,train_time,test_time);  
    
   W=Copy_of_compute_classifier_parametrs( Z1,tr_label); 
  [acc] = predic_labels( Z2,ts_label,W); 
    fprintf('归一化0.8:acc \t training time \t testing time\n'); 
   fprintf('         %f   \t  %f          \t %f      \n',acc,train_time,test_time);  
   [SF_S_acc(i),SF_W_acc(i)] = HGHnew( U_hat,Sigma_hat,V_hat,X2,tr_label,ts_label,1e-4); 
end 
 
SF_S_avg = mean(SF_S_acc);                
SF_S_std  = std(SF_S_acc);                
SF_W_avg= mean(SF_W_acc);                
SF_W_std = std(SF_W_acc);   
SF_avg= mean(SF_acc);                
SF_std = std(SF_acc);  
 
RobustLatLRRZ_avg= mean(RobustLatLRRZ_acc);                
RobustLatLRRZ_std = std(RobustLatLRRZ_acc);   
RobustLatLRRLX_avg= mean(RobustLatLRRLX_acc);                
RobustLatLRRLX_std = std(RobustLatLRRLX_acc);  
 
fprintf('Robust SF S Avr: %f\n', SF_S_avg); 
fprintf('Robust SF S Std: %f\n',SF_S_std);     
 
 
fprintf('Robust SF W Avg: %f\n',SF_W_avg); 
fprintf('Robust SF W Std: %f\n',SF_W_std); 
 
fprintf('Robust SF  Avg: %f\n',SF_avg); 
fprintf('Robust SF   Std: %f\n',SF_std); 
 
fprintf('Robust Z Avg: %f\n',RobustLatLRRZ_avg); 
fprintf('Robust Z Std: %f\n',RobustLatLRRZ_std); 
 
fprintf('Robust LX Avg: %f\n',RobustLatLRRLX_avg); 
fprintf('Robust LX Std: %f\n',RobustLatLRRLX_std);