ML Wiki
Machine Learning Wiki - A collection of ML concepts, algorithms, and resources.

Trace (Matrix)

Trace (Matrix)

Properties:

Why

$\text{tr}(V U^T) = \sum_{ij} v_{ij} u_{ij}$ when $V$ and $U$ are both $m \times n$

$J = 0.5 \text{tr}\Big( (A - UV^T)^T \, (A - UV^T) \Big) = \text{tr}\Big( AA^T - 2 A U V^T + U V^T V U^T \Big) = 0.5 \text{tr} (AA^T) - \text{tr}(A U V^T) + 0.5 \text{tr}(U V^T V U^T)$