Commit d6b75591 authored by Joanna Luberadzka's avatar Joanna Luberadzka

i want to run finally on the cluster

parent 8a406b11
clc
clear
close all
sname='pilot';
SNR=[-Inf -10 -5 0 5];
Nrtrials=20;
ax=[-90:5:90];
scase={'case1', 'case2', 'case3'}
for c=1:length(scase)
for s=1:length(SNR)
matfilename= [sname,'_', scase{c}, '_SNR',num2str(SNR(s)),'N1000_test.mat'];
load(matfilename);
DOAentropy=zeros(Nrtrials,2);
for n=1:Nrtrials
figure(c*100+s*10+1)
% subplot(2,1,1)
subplot(3,2,1)
plot(ax,sTEST_RESULTS.entropy{n});
[a b]=min(sTEST_RESULTS.entropy{n});
DOAentropy(n,:)=[a b]
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy'])
hold all
% figure(s*10+2)
% subplot(2,1,1)
subplot(3,2,3)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10,'sgolay'))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10,'sgolay'));
DOAentropy_sgolay(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy smoothed (s.g.)'])
hold all
% figure(s*10+3)
% subplot(2,1,1)
subplot(3,2,5)
plot(ax,smooth(sTEST_RESULTS.entropy{n},10))
[a b]=min(smooth(sTEST_RESULTS.entropy{n},10));
DOAentropy_movav(n,:)=[a b];
hold on
plot(ax(b),a,'*k')
title([sname,' ', scase{c}, ' SNR ',num2str(SNR(s)),'N1000 Entropy smoothed (m.av.)'])
hold all
% subplot(3,2,5)
% plot(sTEST_RESULTS.BVSB{n});
% [a b]=min(sTEST_RESULTS.BVSB{n});
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 BVSB'])
% hold all
%
% subplot(3,2,6)
% plot(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'))
% [a b]=min(smooth(sTEST_RESULTS.BVSB{n},10,'sgolay'));
% hold on
% plot(b,a,'*k')
% title(['pilot case1 SNR',num2str(SNR(s)),'N1000 Smoothed BVSB'])
% hold all
%
end
% figure(s*10+1)
% subplot(2,1,2)
subplot(3,2,2)
hist(ax(DOAentropy(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
% figure(s*10+2)
% subplot(2,1,2)
subplot(3,2,4)
hist(ax(DOAentropy_sgolay(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
% figure(s*10+3)
% subplot(2,1,2)
subplot(3,2,6)
hist(ax(DOAentropy_movav(:,2)),-90:5:90)
axis([-90 90 0 Nrtrials])
axi=gca;
set(axi,'XTick',[-90 -30 0 30 90])
end
end
......@@ -28,8 +28,10 @@ for n=1:sParamTest.N
if t(n)-(nr_slices-1)/2>0 && t(n)+(nr_slices-1)/2<T
if sParamTest.noise==0
feat_vec_L=reshape(h5read(['TIMIT_MELSPEC_',num2str(angle)], ['/data_',num2str(angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
feat_vec_R=reshape(h5read(['TIMIT_MELSPEC_',num2str(-angle)], ['/data_',num2str(-angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
% feat_vec_L=reshape(h5read(['TIMIT_MELSPEC_',num2str(angle)], ['/data_',num2str(angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
% feat_vec_R=reshape(h5read(['TIMIT_MELSPEC_',num2str(-angle)], ['/data_',num2str(-angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
feat_vec_L=reshape(sParamTest.DATA(1,nr,:,t(n)-((nr_slices-1)/2):t(n)+((nr_slices-1)/2)),nr_slices*F,1);
feat_vec_R=reshape(sParamTest.DATA(2,nr,:,t(n)-((nr_slices-1)/2):t(n)+((nr_slices-1)/2)),nr_slices*F,1);
elseif strcmp(sParamTest.noise,'diff_ss')
% feat_vec_L=reshape(h5read(['TIMIT_MELSPEC_SNR',num2str(sParamTest.SNR),'ang',num2str(angle)], ['/data_',num2str(angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
% feat_vec_R=reshape(h5read(['TIMIT_MELSPEC_SNR',num2str(sParamTest.SNR),'ang',num2str(-angle)], ['/data_',num2str(-angle)], [1 t(n)-((nr_slices-1)/2)], [F,nr_slices]),nr_slices*F,1);
......
......@@ -6,14 +6,14 @@ hspan=floor(span/2);
for i=1:length(v_in)
for s=1:floor(hspan)
idx=i-(hspan-(s-1))
idx=i-(hspan-(s-1));
if idx<=0
idx_l(s)=length(v_in)+idx;
else
idx_l(s)=idx;
end
idx=i+(hspan-(s-1))
idx=i+(hspan-(s-1));
if idx>length(v_in)
idx_r(s)=idx-length(v_in);
else
......
......@@ -41,9 +41,7 @@ for j=1:length(v_head)
end
for kk=1:length(v_angles_test)
kk
parfor kk=1:length(v_angles_test)
% .....................create N data points......................
......@@ -115,10 +113,10 @@ for kk=1:length(v_angles_test)
% v_Error(j)=length(find(v_MAP_correct~=v_MAP_labels))/length(v_MAP_labels);
if sParamTest.display
run('displayeachangle.m');
end
% if sParamTest.display
% run('displayeachangle.m');
%
% end
end
......
......@@ -5,29 +5,36 @@
% Author: Joanna Luberadzka
%
% addpath(genpath());
addpath(genpath('/home/joanna/UNCERTAINTY'))
% addpath(genpath('/home/joanna/UNCERTAINTY'))
datapath='/media/joanna/daten/user/joanna/Data/TIMIT';
%datapath='/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/';
% datapath='/media/joanna/daten/user/joanna/Data/TIMIT';
datapath='/user/fk5/ifp/agmediphys/wuau6202/MATLAB/Projects/UNCERTAINTY/';
addpath(genpath(datapath))
%% PRODUCING UNCERTAINTY CURVES
tic
load(['TIMIT_anecho_A700N500k-06-Sep-2016_traindata.mat' ],'-mat');
SNR=[-10 -5 0 5];
Nrtrials=20;
load(['TIMIT_anecho_A700N500k-06-Sep-2016_traindata.mat' ],'-mat');
SNR=[-Inf -10 -5 0 5];
Nrtrials=100;
sname='hundred';
for s=1:length(SNR)
s
% Read in data sets 270:5:90
if SNR(s)<20
n_cond=0;
else
n_cond='diff_ss';
end
%Read in data sets 270:5:90
tic
DATA=read_in_h5f_data(270,360,90,'diff_ss',SNR(s));
DATA=read_in_h5f_data(270,330,90,n_cond,SNR(s));
t=toc;
......@@ -37,7 +44,7 @@ for i=1:Nrtrials
% test parameters
sParamTest=struct('datatype','spectral_slices','N',1000,'A',700,'epsilon',0.1,...
'noise','diff_ss','SNR',SNR(s),'display',0,'position',[270 360 90] ,'gen_each_time', 1, 'frames', 'rand','DATA',DATA);
'noise',n_cond,'SNR',SNR(s),'display',0,'position',[270 330 90] ,'gen_each_time', 1, 'frames', 'rand','DATA',DATA);
[v_Entropy,v_BVSB, ~, v_Error]=test_for_each_angle(stTrainingData.m_B,stTrainingData.m_W,sParamTest)
......@@ -49,7 +56,7 @@ sTEST_RESULTS.entropy{i}=v_Entropy;
sTEST_RESULTS.BVSB{i}=v_BVSB;
sTEST_RESULTS.error{i}=v_Error;
end
ID=(['pilot_case1_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
ID=([sname,'_case1_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
test_filename=[datapath,'/Uncertainty_Data/TestResults/', ID, '_test.mat' ];
save(test_filename,'sTEST_RESULTS','-v7.3' );
......@@ -59,7 +66,7 @@ for i=1:Nrtrials
% test parameters
sParamTest=struct('datatype','spectral_slices','N',1000,'A',700,'epsilon',0.1,...
'noise','diff_ss','SNR',SNR(s),'display',0,'position',[270 360 90] ,'gen_each_time', 1, 'frames', 'conseq','startat', randi(1400000),'DATA',DATA);
'noise',n_cond,'SNR',SNR(s),'display',0,'position',[270 330 90] ,'gen_each_time', 1, 'frames', 'conseq','startat', randi(1400000),'DATA',DATA);
[v_Entropy,v_BVSB, ~, v_Error]=test_for_each_angle(stTrainingData.m_B,stTrainingData.m_W,sParamTest)
......@@ -71,7 +78,7 @@ sTEST_RESULTS.entropy{i}=v_Entropy;
sTEST_RESULTS.BVSB{i}=v_BVSB;
sTEST_RESULTS.error{i}=v_Error;
end
ID=(['pilot_case2_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
ID=([sname,'_case2_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
test_filename=[datapath,'/Uncertainty_Data/TestResults/', ID, '_test.mat' ];
save(test_filename,'sTEST_RESULTS','-v7.3' );
......@@ -82,7 +89,7 @@ for i=1:Nrtrials
% test parameters
sParamTest=struct('datatype','spectral_slices','N',1000,'A',700,'epsilon',0.1,...
'noise','diff_ss','SNR',SNR(s),'display',0,'position',[270 360 90] ,'gen_each_time', 0, 'frames', 'conseq','startat', randi(1551877),'DATA',DATA);
'noise',n_cond,'SNR',SNR(s),'display',0,'position',[270 330 90] ,'gen_each_time', 0, 'frames', 'conseq','startat', randi(1551877),'DATA',DATA);
[v_Entropy,v_BVSB, ~, v_Error]=test_for_each_angle(stTrainingData.m_B,stTrainingData.m_W,sParamTest)
......@@ -94,11 +101,11 @@ sTEST_RESULTS.entropy{i}=v_Entropy;
sTEST_RESULTS.BVSB{i}=v_BVSB;
sTEST_RESULTS.error{i}=v_Error;
end
ID=(['pilot_case3_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
ID=([sname,'_case3_SNR', num2str(sParamTest.SNR), 'N', num2str(sParamTest.N)]);
test_filename=[datapath,'/Uncertainty_Data/TestResults/', ID, '_test.mat' ];
save(test_filename,'sTEST_RESULTS','-v7.3' );
end
timepilot=toc;
timehundred=toc;
......@@ -27,7 +27,7 @@ myCluster = parcluster(defaultProfile);
jobRW =...
batch(...
myCluster,...
'test',...
'pool',6 ...
'producing_uncert_curves',...
'pool',16 ...
);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment