Skip to content

Commit ae1b6f5

Browse files
authored
Update multi_src_SER.m
1 parent c365d3d commit ae1b6f5

File tree

1 file changed

+16
-103
lines changed

1 file changed

+16
-103
lines changed

multi_src_SER.m

Lines changed: 16 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
X_tar = X(n+1:end,:);
7373
disp("......... Multi-PCA End ........");
7474
disp("========= Split Target Corpus by Emotional Labels (Train : Test) ==========");
75-
% for iii = 1:10
7675
msg = ['According to split=' num2str(split) ' , the target_train:target_test is ' num2str(10*split) ':' num2str(10*(1-split))];
7776
disp(msg);
7877
class_num = max(X_tar_label);
@@ -95,24 +94,21 @@
9594
X_tar_test_label = [X_tar_test_label;X_tar_label(c_p+1:c_e,:)];
9695
end
9796
data = [];
98-
for jj=1:5
99-
%shuffle target_train
100-
X_tt= [X_tar_train,X_tar_train_label];
101-
rowrank = randperm(size(X_tt, 1));
102-
X1 = X_tt(rowrank,:);
103-
X_tar_train = X1(:,1:size(X_tar_train,2));
104-
X_tar_train_label = X1(:,size(X_tar_train,2)+1);
105-
%shuffle target_test
106-
X_tt= [X_tar_test,X_tar_test_label];
107-
rowrank = randperm(size(X_tt, 1));
108-
X1 = X_tt(rowrank,:);
109-
X_tar_test = X1(:,1:size(X_tar_test,2));
110-
X_tar_test_label = X1(:,size(X_tar_test,2)+1);
111-
disp("......... Split End ........");
112-
disp("========= Multi-Disciminant Subspace Alihnment (MDSA) START ==========");
113-
ll = 0;
114-
for g11= [1]
115-
ll=ll+1;
97+
for jj=1:10
98+
%shuffle target_train
99+
X_tt= [X_tar_train,X_tar_train_label];
100+
rowrank = randperm(size(X_tt, 1));
101+
X1 = X_tt(rowrank,:);
102+
X_tar_train = X1(:,1:size(X_tar_train,2));
103+
X_tar_train_label = X1(:,size(X_tar_train,2)+1);
104+
%shuffle target_test
105+
X_tt= [X_tar_test,X_tar_test_label];
106+
rowrank = randperm(size(X_tt, 1));
107+
X1 = X_tt(rowrank,:);
108+
X_tar_test = X1(:,1:size(X_tar_test,2));
109+
X_tar_test_label = X1(:,size(X_tar_test,2)+1);
110+
disp("......... Split End ........");
111+
disp("========= Multi-Disciminant Subspace Alihnment (MDSA) START ==========");
116112
options = [];
117113
options.beta = 8*10^3;%1~8
118114
options.gamma =1.5;%
@@ -138,92 +134,9 @@
138134
disp("Final test acc:");
139135
disp(acc(1));
140136
myacc(ll) = acc(1);
141-
end
142-
data(jj) = acc(1);
137+
data(jj) = acc(1);
143138
end
144139
b = mean(data);
145140
disp(b);
146141
a = std(data,1);
147142
disp(a);
148-
% end
149-
% Zss = [];
150-
% lll = cell(1,num_src_domain);
151-
% for i = 1:num_src_domain
152-
% mm = P{i}*X_src{i}';
153-
% mm=normalization(mm,1);
154-
% Zss = [Zss,mm(:,1:300)];
155-
% lll{i} = X_src_label{i}(1:300,:);
156-
% trials = [trials;300];
157-
% end
158-
% Zss = Zss*diag(sparse(1./sqrt(sum(Zss.^2))));
159-
%
160-
% X =[Zss,Zt];
161-
% % X=normalization(X,1);
162-
% %mahalanobis euclidean
163-
% Y = tsne(X','Algorithm','exact','Distance','cosine');%,'NumPCAComponents',10
164-
% Ys1=Y(1:trials(1),:);
165-
% Ys2=Y(trials(1)+1:trials(1)+trials(2),:);
166-
% Ys3=Y(trials(1)+trials(2)+1:trials(1)+trials(2)+trials(3),:);
167-
% Ys4=Y(trials(1)+trials(2)+trials(3)+1:trials(1)+trials(2)+trials(3)+trials(4),:);
168-
% Y2=Y(trials(1)+trials(2)+trials(3)+1:end,:);
169-
% figure;
170-
% %subplot(2,3,1);
171-
% % axis([-50,50,-50,50]);
172-
%
173-
% scatter(Ys1(lll{1}==1,1),Ys1(lll{1}==1,2),'*','r','LineWidth',1);
174-
% hold on
175-
% scatter(Ys1(lll{1}==2,1),Ys1(lll{1}==2,2),'*','b','LineWidth',1);
176-
% hold on;
177-
% scatter(Ys1(lll{1}==3,1),Ys1(lll{1}==3,2),'*','g','LineWidth',1);
178-
% hold on;
179-
% scatter(Ys1(lll{1}==4,1),Ys1(lll{1}==4,2),'*','y','LineWidth',1);
180-
% hold on;
181-
%
182-
% scatter(Ys2(lll{2}==1,1),Ys2(lll{2}==1,2),'+','r','LineWidth',1);
183-
% hold on
184-
% scatter(Ys2(lll{2}==2,1),Ys2(lll{2}==2,2),'+','b','LineWidth',1);
185-
% hold on;
186-
% scatter(Ys2(lll{2}==3,1),Ys2(lll{2}==3,2),'+','g','LineWidth',1);
187-
% hold on;
188-
% scatter(Ys2(lll{2}==4,1),Ys2(lll{2}==4,2),'+','y','LineWidth',1);
189-
% hold on;
190-
%
191-
% scatter(Ys3(lll{3}==1,1),Ys3(lll{3}==1,2),'o','r','LineWidth',1);
192-
% hold on
193-
% scatter(Ys3(lll{3}==2,1),Ys3(lll{3}==2,2),'o','b','LineWidth',1);
194-
% hold on;
195-
% scatter(Ys3(lll{3}==3,1),Ys3(lll{3}==3,2),'o','g','LineWidth',1);
196-
% hold on;
197-
% scatter(Ys3(lll{3}==4,1),Ys3(lll{3}==4,2),'o','y','LineWidth',1);
198-
% hold on;
199-
%
200-
%
201-
% scatter(Ys4(lll{4}==1,1),Ys4(lll{4}==1,2),'^','r','LineWidth',1);
202-
% hold on
203-
% scatter(Ys4(lll{4}==2,1),Ys4(lll{4}==2,2),'^','b','LineWidth',1);
204-
% hold on;
205-
% scatter(Ys4(lll{4}==3,1),Ys4(lll{4}==3,2),'^','g','LineWidth',1);
206-
% hold on;
207-
% scatter(Ys4(lll{4}==4,1),Ys4(lll{4}==4,2),'^','y','LineWidth',1);
208-
% hold on;
209-
%
210-
%
211-
% scatter(Y2(X_tar_test_label==1,1),Y2(X_tar_test_label==1,2),'d','r','LineWidth',1);
212-
% hold on
213-
% scatter(Y2(X_tar_test_label==2,1),Y2(X_tar_test_label==2,2),'d','b','LineWidth',1);
214-
% hold on;
215-
% scatter(Y2(X_tar_test_label==3,1),Y2(X_tar_test_label==3,2),'d','g','LineWidth',1);
216-
% hold on;
217-
% scatter(Y2(X_tar_test_label==4,1),Y2(X_tar_test_label==4,2),'d','y','LineWidth',1);
218-
% hold on;
219-
220-
% box on;
221-
% view(-20,20);
222-
223-
224-
225-
% act=Zt_label;
226-
% act1=act';
227-
% det=pred_label;
228-
% det1=det';
229-
% confusion_matrix1(act1,det1);

0 commit comments

Comments
 (0)