# 张量分解--非负矩阵分解 (NMF)

## 2.非负矩阵的求解

### 2.1. 乘法更新求解法

D F ( Y ∣ ∣ A X ) = 1 2 ∣ ∣ Y − A X ∣ ∣ F 2 , s . t . a i j ≥ 0 , x j t ≥ 0 , ∀ i , j , t D_{F}\left ( Y||AX \right )=\frac{1}{2}\left|| Y-AX\right||_{F}^{2}, s.t. a_{ij}\ge0, x_{jt}\ge0,\forall{i,j,t}

A ≥ 0 , X ≥ 0 A\ge0, X\ge0
▽ A D F ≥ 0 , ▽ X D F ≥ 0 \bigtriangledown_{A}D_{F}\ge0, \bigtriangledown_{X}D_{F}\ge0
A ∗ ▽ A D F = 0 , X ∗ ▽ X D F = 0 A\ast\bigtriangledown_{A}D_{F}=0, X\ast\bigtriangledown_{X}D_{F}=0

▽ A D F = A X X T − Y X T , ▽ X D F = A T A X − A T Y \bigtriangledown_{A}D_{F}=AXX^{T}-YX^{T}, \bigtriangledown_{X}D_{F}=A^{T}AX-A^{T}Y

A ∗ ( A X X T ) = A ∗ ( Y X T ) , X ∗ ( A T A X ) = X ∗ ( A T Y ) A\ast(AXX^{T})=A\ast(YX^{T}),X\ast(A^{T}AX)=X\ast(A^{T}Y)

A ← A ∗ [ ( Y X T ) ⊘ ( A X X T + ε ) ] A \gets A\ast\left[(YX^{T}) \oslash(AXX^{T}+\varepsilon )\right]
X ← X ∗ [ ( A T Y ) ⊘ ( A T A X + ε ) ] X \gets X\ast\left[(A^{T}Y) \oslash(A^{T}AX+\varepsilon )\right]

### 2.2.最小二乘法求解法

D F ( Y ∣ ∣ A X ) = 1 2 ∣ ∣ Y − A X ∣ ∣ F 2 , s . t . a i j ≥ 0 , x j t ≥ 0 , ∀ i , j , t D_{F}\left ( Y||AX \right )=\frac{1}{2}\left|| Y-AX\right||_{F}^{2}, s.t. a_{ij}\ge0, x_{jt}\ge0,\forall{i,j,t}

A ≥ 0 , X ≥ 0 A\ge0, X\ge0
▽ A D F ≥ 0 , ▽ X D F ≥ 0 \bigtriangledown_{A}D_{F}\ge0, \bigtriangledown_{X}D_{F}\ge0
A ∗ ▽ A D F = 0 , X ∗ ▽ X D F = 0 A\ast\bigtriangledown_{A}D_{F}=0, X\ast\bigtriangledown_{X}D_{F}=0

▽ A D F ( Y ∣ ∣ A X ) = ∂ D F ( Y ∣ ∣ A X ) ∂ A = [ − Y X T + A X X T ] = 0 \bigtriangledown_{A}D_{F}(Y||AX)=\frac{\partial D_{F}(Y||AX)}{\partial A}=\left[-YX^{T}+AXX^{T} \right]=0
▽ A D F ( Y ∣ ∣ A X ) = ∂ D F ( Y ∣ ∣ A X ) ∂ X = [ − A T Y + A T A X ] = 0 \bigtriangledown_{A}D_{F}(Y||AX)=\frac{\partial D_{F}(Y||AX)}{\partial X}=\left[-A^{T}Y+A^{T}AX \right]=0

A ← [ Y X T ( X X T ) − 1 ] + = [ Y X † ] + A \gets \left[YX^{T}\left(XX^{T}\right)^{-1}\right]_{+}=\left[YX^{\dagger }\right]_{+}
X ← [ ( A T A ) − 1 A T Y ] + = [ A † Y ] + X \gets \left[(A^{T}A)^{-1}A^{T}Y\right]_{+}=\left[A^{\dagger }Y\right]_{+}