张量分解(5)——Tucker分解

张量分解(5)——Tucker分解张量分解第五讲 详细介绍了 Tucker 分解的原理 公式 矩阵转化 优化方法等

大家好,欢迎来到IT知识分享网。

🍅 写在前面
👨‍🎓 博主介绍:大家好,这里是hyk写算法了吗,一枚致力于学习算法和人工智能领域的小菜鸟。
🔎个人主页:主页链接(欢迎各位大佬光临指导)
⭐️近期专栏:机器学习与深度学习
                       LeetCode算法实例
                       张量分解

张量分解系列知识,详见下方链接:

张量分解(1)——初探张量

张量分解(2)——张量运算

张量分解(3)——CP分解

张量分解(4)——SVD奇异值分解

张量分解(5)——Tucker分解

Tucker分解综述

Tucker分解是高阶主成分分析的一种形式,它将一个张量分解成核张量与每一维矩阵的乘积。三维张量Tucker分解表示如下图:
在这里插入图片描述

Tucker分解公式

以三维张量 X ∈ R I × J × K \mathcal{X} \in \mathbb{R}^{I \times J \times K} XRI×J×K为例,可以得到Tucker分解公式为:
X ≈ G × 1 A × 2 B × 3 C = ∑ p = 1 P ∑ q = 1 Q ∑ r = 1 R g p q r a p ∘ b q ∘ c r = ⟦ G ; A , B , C ⟧ \boldsymbol{X} \approx \mathcal{G} \times{ }_1 \mathbf{A} \times{ }_2 \mathbf{B} \times{ }_3 \mathbf{C}=\sum_{p=1}^P \sum_{q=1}^Q \sum_{r=1}^R g_{p q r} \mathbf{a}_p \circ \mathbf{b}_q \circ \mathbf{c}_r=\llbracket \mathcal{G} ; \mathbf{A}, \mathbf{B}, \mathbf{C} \rrbracket XG×1A×2B×3C=p=1Pq=1Qr=1Rgpqrapbqcr=[[G;A,B,C]]
有了前几节基础知识的铺垫,相信这里公式不难理解。
这里 A ∈ R I × P , B ∈ R J × Q \mathbf{A} \in \mathbb{R}^{I \times P}, \mathbf{B} \in \mathbb{R}^{J \times Q} ARI×P,BRJ×Q, and C ∈ R K × R \mathbf{C} \in \mathbb{R}^{K \times R} CRK×R是张量的因子矩阵,它们通常是正交的,可以将它们看做每一个维度上的主要成分。
扩展到更高维度,Tucker分解的公式如图:
在这里插入图片描述
Tucker分解也能够转化为矩阵形式,具体形式为:
X ( 1 ) ≈ A G ( 1 ) ( C ⊗ B ) ⊤ , X ( 2 ) ≈ B G ( 2 ) ( C ⊗ A ) ⊤ , X ( 3 ) ≈ C G ( 3 ) ( B ⊗ A ) ⊤ . \begin{aligned} & \mathbf{X}_{(1)} \approx \mathbf{A G}_{(1)}(\mathbf{C} \otimes \mathbf{B})^{\top}, \\ & \mathbf{X}_{(2)} \approx \mathbf{B G}_{(2)}(\mathbf{C} \otimes \mathbf{A})^{\top}, \\ & \mathbf{X}_{(3)} \approx \mathbf{C G}_{(3)}(\mathbf{B} \otimes \mathbf{A})^{\top} . \end{aligned} X(1)AG(1)(CB),X(2)BG(2)(CA),X(3)CG(3)(BA).

Tucker分解优化

Tucker分解的优化通常有两种方法,分别是HOSVD和HOOI。
1、HOSVD:higher-order SVD(HOSVD),它通过张量的每一个mode上做SVD分解对各个mode上的因子矩阵进行求解,最后计算张量在各个mode上的投影之后的张量作为核张量。它的算法过程如下图所示:
在这里插入图片描述
最终优化目标为:
∣ X − [ [ G ; A ( 1 ) , ⋯   , A ( N ) ] ] ∣ = ∣ vec ⁡ ( X ) − ( A ( N ) ⊗ ⋯ ⊗ A ( 1 ) ) vec ⁡ ( G ) ∣ \left|\mathcal{X}-\left[\left[\mathcal{G} ; \mathbf{A}^{(1)}, \cdots, \mathbf{A}^{(\mathbb{N})}\right]\right]\right|=\left|\operatorname{vec}(\mathcal{X})-\left(\mathbf{A}^{(\mathbb{N})} \otimes \cdots \otimes \mathbf{A}^{(1)}\right) \operatorname{vec}(\mathcal{G})\right|
X[[G;A(1),,A(N)]]
=

vec(X)(A(N)A(1))vec(G)

整体平方化简得:
∥ X − [ G ; A ( 1 ) , ⋯   , A ( N ) ] ∥ 2 = ∥ X ∥ 2 − 2 ⟨ X , [ G ; A ( 1 ) , ⋯   , A ( N ) ∥ ⟩ + ∥ G ; A ( 1 ) , ⋯   , A ( N ) ] ∥ 2 = ∥ X ∥ 2 − 2 ⟨ X × 1 A ( 1 ) T … × N A ( N ) T , G ⟩ + ∥ G ∥ 2 = ∥ X ∥ 2 − 2 ⟨ G , G ⟩ + ∥ G ∥ 2 = ∥ X ∥ 2 − ∥ X × 1 A ( 1 ) T ⋯ × N A ( N ) T ∥ 2 \begin{aligned} & \left\|\mathcal{X}-\left[\mathcal{G} ; \mathbf{A}^{(1)}, \cdots, \mathbf{A}^{(\mathrm{N})}\right]\right\|^2 \\ = & \|\mathcal{X}\|^2-2\left\langle\mathcal{X},\left[\mathcal{G} ; \mathbf{A}^{(1)}, \cdots, \mathbf{A}^{(\mathrm{N})} \|\right\rangle+\| \mathcal{G} ; \mathbf{A}^{(1)}, \cdots, \mathbf{A}^{(\mathrm{N})}\right] \|^2 \\ = & \|\mathcal{X}\|^2-2\left\langle\mathcal{X} \times_1 \mathbf{A}^{(1) \mathrm{T}} \ldots \times_{\mathrm{N}} \mathbf{A}^{(\mathrm{N}) \mathrm{T}}, \mathcal{G}\right\rangle+\|\mathcal{G}\|^2 \\ = & \|\mathcal{X}\|^2-2\langle\mathcal{G}, \mathcal{G}\rangle+\|\mathcal{G}\|^2 \\ = & \|\mathcal{X}\|^2-\left\|\mathcal{X} \times_1 \mathbf{A}^{(1) \mathrm{T}} \cdots \times_{\mathrm{N}} \mathbf{A}^{(\mathrm{N}) \mathrm{T}}\right\|^2 \end{aligned} ====
X[G;A(1),,A(N)]
2
X22X,[G;A(1),,A(N)+G;A(1),,A(N)]2X22X×1A(1)T×NA(N)T,G+G2X22G,G+G2X2
X×1A(1)T×NA(N)T
2

由于 ∥ X ∥ \|\mathcal{X}\| X 是一个常数,最小化上面的式子相当于最大化后面的: max ⁡ ∥ X × 1 A ( 1 ) T ⋯ × N A ( N ) T ∥ \max \left\|\mathcal{X} \times{ }_1 \mathbf{A}^{(1) \mathrm{T}} \cdots \times_{\mathrm{N}} \mathbf{A}^{(\mathrm{N}) \mathrm{T}}\right\| max
X×1A(1)T×NA(N)T
最终得到:
max ⁡ ∥ A ( n ) T W ∥  s.t.  W = X ( n ) ( A ( N ) ⊗ … ⊗ A ( n + 1 ) ⊗ A ( n − 1 ) ⋯ ⊗ A ( 1 ) ) \begin{aligned} & \max \left\|\mathbf{A}^{(\mathrm{n}) \mathrm{T}} \mathbf{W}\right\| \\ & \text { s.t. } \mathbf{W}=\mathbf{X}_{(\mathrm{n})}\left(\mathbf{A}^{(\mathrm{N})} \otimes \ldots \otimes \mathbf{A}^{(\mathrm{n}+1)} \otimes \mathbf{A}^{(\mathrm{n}-1)} \cdots \otimes \mathbf{A}^{(1)}\right) \\ & \end{aligned} max
A(n)TW
 s.t. W=X(n)(A(N)A(n+1)A(n1)A(1))

2、HOOI:这个算法本人还不是太了解,暂且将步骤放在这里。
在这里插入图片描述

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/154500.html

(0)
上一篇 2025-02-25 17:10
下一篇 2025-02-25 17:15

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信