Home > release > tensor_as_matrix.m

tensor_as_matrix

PURPOSE ^

TENSOR_AS_MATRIX - Computes the reconstruction of partly observed

SYNOPSIS ^

function [X,Z,fval,gval]=tensor_as_matrix(X, I, Bv, eta, tol);

DESCRIPTION ^

 TENSOR_AS_MATRIX - Computes the reconstruction of partly observed
                    tensor via "As A Matrix" approach

 Syntax
  function [X,Z,fval,gval]=tensor_as_matrix(X, I, Bv, eta, tol);

 See also
  MATRIX_ADM

 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 % TENSOR_AS_MATRIX - Computes the reconstruction of partly observed
0002 %                    tensor via "As A Matrix" approach
0003 %
0004 % Syntax
0005 %  function [X,Z,fval,gval]=tensor_as_matrix(X, I, Bv, eta, tol);
0006 %
0007 % See also
0008 %  MATRIX_ADM
0009 %
0010 % Reference
0011 % "On the extension of trace norm to tensors"
0012 % Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima
0013 % arXiv:1010.0789
0014 % http://arxiv.org/abs/1010.0789
0015 %
0016 % Copyright(c) 2010 Ryota Tomioka
0017 % This software is distributed under the MIT license. See license.txt
0018 
0019 
0020 function [X,Z,fval,gval]=tensor_as_matrix(X, I, Bv, eta, tol);
0021 
0022 if ~exist('tol','var')
0023   tol=1e-3;
0024 end
0025 
0026 sz=size(X);
0027 nd=ndims(X);
0028 
0029 Z=cell(1,nd);
0030 for ii=1:nd
0031   szp=[sz(ii:end) sz(1:ii-1)];
0032   Ip=[I(ii:end) I(1:ii-1)];
0033   J =sub2ind(szp(2:end), Ip{2:end});
0034   [Z1,Z{ii},Y,fval1,gval1]=matrix_adm(zeros(szp(1),prod(szp(2:end))),{Ip{1}, ...
0035                       J}, Bv, 0, eta, tol);
0036   fval(ii)=fval1(end);
0037   gval(ii)=gval1(end);
0038 end
0039 
0040 X=[];

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