Professional Documents
Culture Documents
Tensors
8 May 2014
Introduction to Tensors
• What is a … tensor?
• Basic Operations
Tullio Levi-Civita
What is a … tensor?
• A tensor is a multi-way extension of a matrix
• A multi-dimensional array 0 1
• A multi-linear map 8 1 6
• In particular, the following
@ 3 5 7A
132011)
(13, 42,
are all tensors:
4 9 2
• Scalars
• Vectors
• Matrices
Why Tensors?
• Tensors can be used when matrices are not enough
• Or other matrices
• But using tensors for time series should be approached with care
Terminology
• Tensor is N-way array
• N-dimensional
• rank-N
slice of a third-order
(a) Mode-1 tensor,
(column) fibers: (b), Mode-2
x X::k may be(row)
denoted
fibers:more
x compactly as Xkfibers:
(c) Mode-3 (tube) . xij:
:jk i:k
Slices are two-dimensional sections of a tensor, defined by fixing all but two
indices. Figure 2.2 shows the horizontal, lateral, and frontal slides of a third-order
tensor X, denoted by Xi:: , X:j: , and X::k , respectively. Alternatively, the kth frontal
3 In some fields, the order of the tensor is referred to as the rank of the tensor. In much of the
literature and this review, however, the term rank means something quite di↵erent; see §3.1.
(a) Horizontal slices: Xi:: (b) Lateral slices: X:j: (c) Frontal slices: X::k (or Xk )
X =
= b
X
a
X=a b c
X
The CP Tensor
Decomposition
c1 c2 cR
X ⇡ b1 + b2 + · · · + bR
a1 a2 aR
R
X
xijk ⇡ air bjr ckr
r=1
More on CP
• The size of the CP decomposition is the
number of rank-1 tensors involved
Name Proposed by
Polyadic Form of a Tensor Hitchcock, 1927 [105]
PARAFAC (Parallel Factors) Harshman, 1970 [90]
CANDECOMP or CAND (Canonical decomposition) Carroll and Chang, 1970 [38]
Topographic Components Model Möcks, 1988 [166]
CP (CANDECOMP/PARAFAC) Kiers, 2000 [122]
R
⇤
xijk ⇧ air bjr ckr , for i = 1, . . . , I, j = 1, . . . , J, kKolda
= 1, .&. .Bader
, K. 2009
r=1
Tensor Rank
• The rank of a tensor is the minimum number of
rank-1 tensors needed to represent the tensor exactly
c1 c2 cR
X = b1 + b2 + · · · + bR
a1 a2 aR
Tensor Rank Oddities #1
✓✓ ◆ ✓ ◆◆
• The rank of a (real-valued) 1 0 0 1
X= ,
tensor is different over 0 1 1 0
reals and over complex
✓ ✓ ◆
numbers. 11 01 11
A= p ,
02 1 i 1i
• With reals, the rank can ✓ ✓ ◆◆
11 01 11
be larger than the largest B= p , ,
02 1i 1 i
dimension ✓ ◆ ◆
11 11 0
• rank(X) ≤ min{IJ, IK, JK}
C=
i1 1 1
for I-by-J-by-K tensor
Tensor Rank Oddities #2
• There are tensors of rank R that can be approximated
arbitrarily well with tensors of rank R’ for some R’ < R.
0 1
1,1 b1,1 1,2 b1,2 ··· 1,m b1,m
B 2,1 b2,1 2,2 b2,2 ··· 2,m b2,m C
A B=B
@ .. .. .. .. C
A
. . . .
n,1 bn,1 n,2 bn,2 ··· n,m bn,m
Kronecker Matrix Product
• Element-per-matrix product
T
X (1) = A(C B)
T
X (2) = B(C A)
T
X (3) = C(B A)
Solving CP: The ALS
Approach