Home > manopt > manifolds > ttfixedrank > TTeMPS_1.1 > algorithms > completion > completion.m

# completion

## PURPOSE

Completion for Tensor train but without individual orthogonalization

## SYNOPSIS

function [X,cost,test] = completion( A_Omega, Omega, A_Gamma, Gamma, X, maxiter, cg )

## DESCRIPTION

``` Completion for Tensor train but without individual orthogonalization

## CROSS-REFERENCE INFORMATION

This function calls:
• disp DISP Display TT/MPS tensor.
• innerprod INNERPROD Inner product between two TT/MPS tensors.
• norm NORM Norm of a TT/MPS tensor.
• orthogonalize ORTHOGONALIZE Orthogonalize tensor.
• disp DISP Display TT/MPS block-mu tensor.
• innerprod INNERPROD Inner product between two TT/MPS tensors.
• norm NORM Norm of a TT/MPS block-mu tensor.
• orthogonalize ORTHOGONALIZE Orthogonalize TT/MPS Block-mu tensor.
• disp DISP Display TT/MPS operator.
• disp DISP Display TT/MPS operator.
• TTeMPS_tangent
• orthogonalize Orthonormalizes a basis of tangent vectors in the Manopt framework.
This function is called by:

## SOURCE CODE

```0001 % Completion for Tensor train but without individual orthogonalization
0002 % (TTeMPS_tangent instead of TTeMPS_tangent_orth)
0003 %
0004 % WARNING: use completion_orth instead!
0005
0006 %   TTeMPS Toolbox.
0007 %   Michael Steinlechner, 2013-2016
0008 %   Questions and contact: michael.steinlechner@epfl.ch
0010 function [X,cost,test] = completion( A_Omega, Omega, A_Gamma, Gamma, X, maxiter, cg )
0011
0012     n = X.size;
0013     r = X.rank;
0014
0015     cost = zeros(maxiter,1);
0016     test = zeros(maxiter,1);
0017     for i = 1:maxiter
0019         xi = TTeMPS_tangent(X, grad, Omega);
0020         %xi_full = full(xi, X);
0021         ip_xi_xi = innerprod(xi, xi, X);
0022         if (i == 1) || (~cg)
0023             eta = -xi;
0024         else
0025             ip_xitrans_xi = innerprod( xi_trans, xi, X);
0026             theta = ip_xitrans_xi / ip_xi_xi;
0027             if theta >= 0.3
0028                 eta = -xi;
0029                 disp('steepest descent step')
0030             else
0031                 disp('CG step')
0032                 beta = ip_xi_xi/ip_xi_xi_old;
0033                 eta = -xi + beta*TTeMPS_tangent( X, eta );
0034             end
0035         end
0036
0037         %line search
0038         eta_Omega = at_Omega( eta, Omega, X);
0039         alpha = -(eta_Omega'*grad) / norm(eta_Omega)^2;
0040
0041         X = tangentAdd( eta, alpha, X, true);
0042         X = orthogonalize( X, X.order);
0043         cost(i) = func(A_Omega, X, Omega);
0044         test(i) = func(A_Gamma, X, Gamma);
0045         ip_xi_xi_old = ip_xi_xi;
0046         xi_trans = TTeMPS_tangent( X, xi);
0047     end
0048
0049 end
0050
0051
0052 function res = func(A_Omega, X, Omega)
0053     res = 0.5*norm( A_Omega - X(Omega) )^2;
0054 end
0055
0056 function res = euclidgrad(A_Omega, X, Omega)
0057     res = X(Omega) - A_Omega;
0058 end```

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005