-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript_run_cell_mtl_syn.m
72 lines (45 loc) · 1.4 KB
/
script_run_cell_mtl_syn.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
% overall experiments.
% clc;
clear;
addpath(genpath('./'))
timeflag = strrep(datestr(datetime),' ','');
disp(timeflag);
timeflag = strrep(timeflag,':','-');
timeflag = timeflag(1:end-3);
% configurePara = struct(...
% 'inDataDir', '../../../../AllData/multi_task/datas/',...
% 'resultDir', '../../../../AllData/multi_task/results/',...
% 'tunedParas', struct(...
% 'lambdas' , [10],...
% 'mus' , [10]...
% )...
% );
%% Load Data
dims = 10 ;
task = 10;
samp = 500;
len_dim = length(dims);
datatype = 'sp';
Methods = {'RR','STIL','MTL_L','MTIL_L_S','MTIL_S_Ln', 'MTIL_S_Lc','MTIL_S_S','MTIL_L_Lc', 'MTIL_L_Ln'};
rmses = zeros(len_dim,length(Methods));
for i = 1:len_dim
dim = dims(i);
configurefile
dataDir = configurePara.inDataDir;
dataname = sprintf(strcat('Syn_', datatype, '_mtl_dim%d_task%d_samp%d.mat'),dim,task,samp);
realdata = strcat(dataDir, dataname);
load_data = load(realdata);
% for syn
Xtest = load_data.Xtest;
Ytest = load_data.Ytest;
Xtrain = load_data.Xtrain;
Ytrain = load_data.Ytrain;
%% Run Methods
disp(sprintf('the %d iteration',i));
for kk = 1:length(Methods)
f = str2func(strcat(Methods{kk},'_cell'));
tic;
rmses(i,kk) = f(Xtrain,Ytrain,Xtest,Ytest,dataname,timeflag,configurePara.(Methods{kk}));
toc;
end
end