Computes the (truncated) higher-order SVD of a tensor, returning a Tucker
representation whose factor matrices span the leading left singular spaces
of the mode-n unfoldings. Mirrors the MATLAB Tensor Toolbox hosvd.
Arguments
- X
A Tensor or array-like object.
- ranks
Optional integer vector of per-mode truncation ranks. Scalar inputs are replicated across modes.
- tol
Relative truncation tolerance. Ignored when
ranksis supplied. Per-mode truncation keeps enough singular vectors to ensure the dropped energy is belowtol^2 / ndims(X)offnorm(X)^2.- dimorder
Order in which modes are processed (matters only for
sequential = TRUE).- sequential
Logical; if
TRUE(default) the ST-HOSVD variant is used, progressively contracting the core, which is typically more accurate and cheaper than the classical HOSVD.- verbosity
Non-negative integer controlling diagnostic messages.