Home > release > plot_tensorworkshop10.m

plot_tensorworkshop10

PURPOSE ^

PLOT_TENSORWORKSHOP10 - Plots Figure 1

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 PLOT_TENSORWORKSHOP10 - Plots Figure 1

 Example
  load('result_compare5_new_50_50_20_7_8_9.mat')
  plot_tensorworkshop10

 Reference
 "On the extension of trace norm to tensors"
 Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima
 arXiv:1010.0789
 http://arxiv.org/abs/1010.0789
 
 Copyright(c) 2010 Ryota Tomioka
 This software is distributed under the MIT license. See license.txt

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % PLOT_TENSORWORKSHOP10 - Plots Figure 1
0002 %
0003 % Example
0004 %  load('result_compare5_new_50_50_20_7_8_9.mat')
0005 %  plot_tensorworkshop10
0006 %
0007 % Reference
0008 % "On the extension of trace norm to tensors"
0009 % Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima
0010 % arXiv:1010.0789
0011 % http://arxiv.org/abs/1010.0789
0012 %
0013 % Copyright(c) 2010 Ryota Tomioka
0014 % This software is distributed under the MIT license. See license.txt
0015 
0016 
0017 % load('result_compare5_50_50_20_7_8_9.mat')
0018 nm = size(err,3);
0019 
0020 if ~exist('tol','var')
0021   tol=1e-3;
0022 end
0023 
0024 figure, h=errorbar_logsafe(trfrac'*ones(1,nm), shiftdim(mean(err)), shiftdim(std(err)));
0025 
0026 set(gca,'fontsize',14,'yscale','log');
0027 ylim([1e-5 1e+2]);
0028 
0029 set(h,'linewidth',2);
0030 set(h(1:3),'color',[0 0 1]);
0031 set(h(1),'linestyle','--');                                
0032 set(h(2),'linestyle','-.');
0033 
0034 col=get(gca,'colororder');
0035 for ii=4:7, set(h(ii),'color', col(ii-2,:)); end
0036 
0037 hold on;
0038 plot(xlim, tol*[1 1], '--', 'color', [.5 .5 .5], 'linewidth',2);
0039 
0040 
0041 grid on;
0042 xlabel('Fraction of observed elements');
0043 ylabel('Generalization error');
0044 legend('As a Matrix (mode 1)',...
0045        'As a Matrix (mode 2)', ...
0046        'As a Matrix (mode 3)',...
0047        'Constraint',...
0048        'Mixture',...
0049        'Tucker (large)',...
0050        'Tucker (exact)',...
0051        'Optimization tolerance',...
0052        'Location','NorthEastOutside');
0053 
0054 h=get(gca,'children');
0055 set(gca,'children',h([2:end,1]));
0056 
0057 set(gcf,'PaperSize',[20 20]);

Generated on Wed 22-Dec-2010 16:09:20 by m2html © 2003