Higher-order Singular Value Decomposition
The Higher-order Singular Value Decomposition (HOSVD) is the generalization of the matrix SVD, also called an orthogonal Tucker decomposition. HOSVD is used in cases where the solution snapshots are most naturally condensed into generalized matrices (tensors) and do not lend themselves naturally to vectorization. Let \(A \in \mathbb{R}^{I_1 \times I_2 \times ,..,\times I_N}\) be an input Nth-order tensor containing the solution snapshots from a numerical simulation. The HOSVD decomposes \(A\) as
where \(\times_N\) denotes an n-mode tensor-matrix product.
By the above equation and the commutative property of n-mode product, one can obtain the following relation
By using the properties of the n-mode product together with the definitions of Kronecker product, one can compute the n-mode unfolding of \(A\) as
The ordering and orthogonality properties of \(S\) imply that \(S(n)\) has mutually orthogonal rows with Frobenius norms equal to \(\sigma_1^{n},\sigma_2^{n},...,\sigma_{I_n}^{n}\). Since the right and left resulting matrices in the above equation are both orthogonal the following can be defined
Classical SVD must be performed to the unfolded matrices as
The HOSVD provides a set of bases \(\mathbf{U}^{(1)},...,\mathbf{U}^{(N-1)}\) spanning each dimension of the snapshots plus a basis, \(\mathbf{U}^{(N)}\), spanning across the snapshots and the orthogonal core tensor, which generalizes the matrix of singular values. Finally, the reconstructed tensor can be computed as follows
where \(\mathbf{U}(N))( \xi_{k})\) has dimension \(n \times 1\), where n is the number of snapshots and corresponds to the kth column of \(\mathbf{U}(N)\) and is the number of independent bases that account for the desired accuracy of the reconstruction.
More information can be found in [7], [8].
HOSVD Class
The HigherOrderSVD
class is imported using the following command:
>>> from UQpy.dimension_reduction.hosvd.HigherOrderSVD import HigherOrderSVD
One can use the following command to instantiate the class HigherOrderSVD
- class HigherOrderSVD(solution_snapshots, modes=10000000000, reconstruction_percentage=10000000000)[source]
- Parameters:
solution_snapshots (
Union
[ndarray
,list
]) – Second order tensor or list containing the solution snapshots. Third dimension or length of list corresponds to the number of snapshots.modes (
int
) – Number of modes to keep for dataset reconstruction.reconstruction_percentage (
Union
[float
,int
]) – Dataset reconstruction percentage.
- factorize(get_error=False)[source]
Executes the HOSVD method.
- Parameters:
get_error (
bool
) – A boolean declaring whether to return the reconstruction error.
- static unfold3d(second_order_tensor)[source]
- Parameters:
second_order_tensor (
ndarray
) – A three-dimensionalndarray
which contains the data to be unfolded.- Returns:
Three unfolded matrices in the form of two-dimensional
ndarray
.