Tensor Node Notation
Decompositions
Leaves-to-root truncation
Given a tensor node
and a set of mode names m such that the corresponding graph G is plain, we can decompose this tensor into a representation Nwith according mode names. LTRT also returns the standard representation of the output N.
alpha = mna('alpha',1:6);
S = binary_tree(alpha);
[G,m,~,~,beta] = RTLGRAPH(alpha,S,'beta');
n = assign_mode_size(alpha,5);
We can use just m to call LTRT:
type LTRT.m
T = init_node(alpha,n);
x = 1:numel(T.data);
T.data(:) = 1/3*x.^5 + 1/3*x.^4 - 1/2*x.^3 - 1/2*x.^2 + 1/2*x - 1; % is low rank
[N,fN,sigma] = LTRT(T,m,1)
The thickness of the lines in the network plot represents its mode sizes and ranks, that is, the sizes of the domains of the internal mode names.
net_view(N)
net_view(fN{:},sigma{:})
n = node_size(N)
We have constructed T such that it is close to a rank 1 representation:
tol = 1/10000;
N_trunc = LTRT(T,m,1,[],tol)
net_view(N_trunc)
n_trunc = node_size(N_trunc)
data_volume(T)
data_volume(N)
data_volume(N_trunc)
net_dist(N,N_trunc)/net_norm(N)
Root-to-leaves truncation
We can apply the root-to-leaves truncation as well. It usually yields slightly better approximation bounds, but is also slightly more time consuming. It also returns the truncated tensor represented by the output.
type RTLT.m
[N_rtl_trunc,T_rtl_trunc] = RTLT(T,m,1,[],[],tol)
net_view(N_rtl_trunc)
net_dist(N_rtl_trunc,N)/net_norm(N)
net_dist(N_rtl_trunc,T_rtl_trunc)/net_norm(T_rtl_trunc)
Truncation based on the standard representation
We may also truncate a tensor based on its representation using the standard representation (or tree SVD):
[~,fN,sigma] = STAND(N,1);
net_dist(N,[fN,sigma])/net_norm(N)
restr = cell(1,length(beta));
[restr{:}] = deal(1);
fNs_trunc = node_part([fN,sigma],beta,restr);
net_dist(fNs_trunc,N_rtl_trunc)/net_norm(N_rtl_trunc)
net_dist(fNs_trunc,N)/net_norm(N)
Without additional computation, the representation can be truncated to any other rank as well.
restr = cell(1,length(beta));
[restr{:}] = deal(1:2);
fNs_trunc = node_part([fN,sigma],beta,restr);
net_dist(fNs_trunc,N_rtl_trunc)/net_norm(N_rtl_trunc)
restr = cell(1,length(beta));
[restr{:}] = deal(1:3);
fNs_trunc = node_part([fN,sigma],beta,restr);
net_dist(fNs_trunc,N_rtl_trunc)/net_norm(N_rtl_trunc)
Instead of a common rank, we may also truncate to the earlier computed ranks in n_trunc:
for i = 1:length(beta)
restr{i} = 1:n_trunc.(beta{i});
end
fNs_trunc = node_part([fN,sigma],beta,restr);
net_dist(fNs_trunc,N_rtl_trunc)/net_norm(N_rtl_trunc)