Deep Learning Book
Chapter 2
Hyeong Goo, Kang
Uncoded
12kay226@gmail.com
2019-09-01
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 1 / 32
Overview
1 2.1 Scalars, Vectors, Matrices and Tensors
2 2.2 Multiplying Matrices and Vectors
3 2.3 Identity and Inverse Matrices
4 2.4 Linear Dependence and Span
5 2.5 Norms
6 2.6 Special Kinds of Matrices and Vectors
7 2.7 Eigendecomposition
8 2.8 Singular Value Decomposition
9 2.9 The Moore-Penrose Pseudoinverse
10 2.10 The Trace Operator
11 2.11 The Determinant
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 2 / 32
2.1 Scalars, Vectors, Matrices and Tensors
Scalars: A scalar is just a single number. we might say “s ∈ R” while
defining a real-valued scalar, or “n ∈ N” while defining a natural
number scalar
Vectors: A vector is an array of numbers. The numbers are arranged
in order. We can think of vectors as identifying points in space, with
each element giving the coordinate along a dierent axis.
x =





x1
x2
...
xn





Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 3 / 32
2.1 Scalars, Vectors, Matrices and Tensors
Figure: Scalar and Vector
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 4 / 32
2.1 Scalars, Vectors, Matrices and Tensors
Matrices: A matrix is a 2-D array of numbers, so each element is
identified by two indices instead of just one. If a real-valued matrix
mathbfA has a height of m and a width of n, then we say that
A ∈ Rm×n
x =
A1,1 A1,2
A2,1 A2,2
Tensors: In some cases we will need an array with more than two
axes. We identify the element of tensor at coordinates (i, j, k) by
writing Ai,j,k
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 5 / 32
2.1 Scalars, Vectors, Matrices and Tensors
Add: We can add matrices to each other, as long as they have the
same shape, just by adding their corresponding elements. C = A + B
where Ci,j = Ai,j + Bi,j
Multiply a scalar: We can multiply a scalar to a matrix. just by
performing that operation on each element of a matrix.D = a · B
where Di,j = a · Bi,j
Transpose: AT
i,j
= Aj,i
Broadcasting: In the context of deep learning, we also use some less
conventional notation. C = A + b where Ci,j = Ai,j + bj
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 6 / 32
2.2 Multiplying Matrices and Vectors
Matrix product: The matrix product of matrices A and B is a third
matrix C. In order for this product to be dened, A must have the
same number of columns as B has rows.
C = AB
Ci,j =
k
Ai,kBk,j
Dot product: between two vectors x and y of the same dimensionality
is the matrix product xT · y
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 7 / 32
2.2 Multiplying Matrices and Vectors
Distributive property: A (B + C) = AB + AC
Associative property: A (BC) = (AB) C
Commutative property: Matrix multiplication is not commutative.
However, the dot product between two vectors is commutative.
xT · y = yT · x
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 8 / 32
2.3 Identity and Inverse Matrices
Identity matrix: An identity matrix is a matrix that does not change
any vector when we multiply that vector by that matrix. We denote
the identity matrix that preserves n-dimensional vectors as In.
Formally, In ∈ Rn×n and ∀x ∈ Rn, Inx = x
Inverse Matrix: The matrix inverse of A is denoted as A−1
, and it is
dened as the matrix such that A−1
A = In. If A have inverse matrix,
We can solve Ax = b using the following steps.
Ax = b
A−1
Ax = A−1
b
Inx = A−1
b
x = A−1
b
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 9 / 32
2.4 Linear Dependence and Span
For A−1
to exist, Ax = b must have exactly one solution for every value of
b. It is also possible for the system of equations to have no solutions or
innitely many solutions for some values of b.
It is not possible, however, to have more than one but less than innitely
many solutions for a particular b; if both x and y are solutions,
z = αx + (1 − α)y
is also a solution for any real α
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 10 / 32
2.4 Linear Dependence and Span
A linear combination of some set of vectors v(1), . . . , v(n) is given by
multiplying each vector v(i) by a corresponding scalar coecient and adding
the results
i
ci v(i)
The span of a set of vectors is the set of all points obtainable by linear
combination of the original vectors
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 11 / 32
2.4 Linear Dependence and Span
Determining whether Ax = b has a solution thus amounts to testing
whether b is in the span of the columns of A. This particular span is
known as the column space, or the range, of A
Ax =
i
xi A:,i
The system Ax = b to have a solution for all values of b ∈ Rn , we
therefore require that the column space of A be all of Rm.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 12 / 32
2.4 Linear Dependence and Span
The requirement that the column space of A be all of Rm implies
immediately that A must have at least m columns, that is, n ≥ m.
Having n ≥ m is only a necessary condition for every point to have a
solution.It is not a sucient condition, because it is possible for some of
the columns to be redundant.
Formally, this kind of redundancy is known as linear dependence. A
set of vectors is linearly independent if no vector in the set is a linear
combination of the other vectors.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 13 / 32
2.4 Linear Dependence and Span
matrix to have an inverse, we additionally need to ensure that
equation Ax = b has at most one solution for each value of b.
This means that the matrix must be square, that is, we require that
m = n and that all the columns be linearly independent. A square
matrix with linearly dependent columns is known as singular.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 14 / 32
2.5 Norms
Sometimes we need to measure the size of a vector. In machine learning,
we usually measure the size of vectors using a function called a norm.
Formally, the Lp norm is given by
||x||p = (
i
|xi |p
)
1
p
for p ∈ R, p ≥ 1
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 15 / 32
2.5 Norms
Norms, including the Lp norm, are functions mapping vectors to
non-negative values. On an intuitive level, the norm of a vector x measures
the distance from the origin to the point x. More rigorously, a norm is any
function f that satises the following properties:
f (x) = 0 ⇒ x = 0
f (x + y) ≤ f (x) + f (y) (the triangle inequality)
α ∈ R, f (αx) = |α|f (x)
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 16 / 32
2.5 Norms
Figure: the triangle inequality
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 17 / 32
2.5 Norms
The L2 norm, with p = 2, is known as the Euclidean norm, which is
simply the Euclidean distance from the origin to the point identied by
x. The L2 norm is used so frequently in machine learning that it is
often denoted simply as ||x||, with the subscript 2 omitted.
The L1 norm is commonly used in machine learning when the dierence
between zero and nonzero elements is very important. Every time an
element of x moves away from 0 by , the L1 norm increases by
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 18 / 32
2.5 Norms
Sometimes we may also wish to measure the size of a matrix. In the
context of deep learning, the most common way to do this is with the
Frobenius norm
||A||F =
i,j
|Ai,j |2)
The dot product of two vectors can be rewritten in terms of norms
xT
y = ||x||2||y||2 cos θ
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 19 / 32
2.6 Special Kinds of Matrices and Vectors
Diagonal matrices consist mostly of zeros and have nonzero entries
only along the main diagonal. Formally, a matrixDis diagonal if and
only if Di,j = 0 for all i = j.
We write diag(v) to denote a square diagonal matrix whose diagonal
entries are given by the entries of the vector v. The inverse exists only
if every diagonal entry is nonzero,and in that case,
diag(v)−1
= diag([1/v1, . . . , 1/vn]T
)
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 20 / 32
2.6 Special Kinds of Matrices and Vectors
A symmetric matrix is any matrix that is equal to its own transpose:
A = AT
A unit vector is a vector with unit norm:
||A||2 = 1
A vector x and a vector y are orthogonal to each other if xT y = 0. If
both vectors have nonzero norm, this means that they are at a 90
degree angle to each other.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 21 / 32
2.6 Special Kinds of Matrices and Vectors
If the vectors not only are orthogonal but also have unit norm, we call
them orthonormal
An orthogonal matrix is a square matrix whose rows are mutually
orthonormal and whose columns are mutually orthonormal:
AT
A = AAT
= I
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 22 / 32
2.7 Eigendecomposition
An eigenvector of a square matrix A is a nonzero vector v such that
multiplication by A alters only the scale of v:
Av = λv
The scalar λ is known as the eigenvalue corresponding to this
eigenvector.
If v is an eigenvector of A, then so is any rescaled vectors v for
s ∈ R, s = 0 Moreover, sv still has the same eigenvalue.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 23 / 32
2.7 Eigendecomposition
Suppose that a matrix A has n linearly independent eigenvectors
v(1), . . . , v(n) with corresponding eigenvalues λ1, . . . , λn. We may
concatenate all the eigenvectors to form a matrix V with one
eigenvector per column and the eigenvalues to form a vector λ
A = Vdiag(λ)V−1
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 24 / 32
2.7 Eigendecomposition
Specically, every real symmetric matrix can be decomposed into an
expression using only real-valued eigenvectors and eigenvalues:
A = QΛQT
where Q is an orthogonal matrix composed of eigenvectors of A, and
Λ is a diagonal matrix.
A matrix whose eigenvalues are all positive is called positive denite. A
matrix whose eigenvalues are all positive or zero valued is called
positive semidenite.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 25 / 32
2.8 Singular Value Decomposition
The singular vectorsandsingular values enables us to discover some of
the same kind of information as the eigendecomposition reveals;
however, the SVD is more generally applicable. Every real matrix has
a singula rvalue decomposition, but the same is not true of the
eigenvalue decomposition
A = UDVT
The matrices U and V are both dened to be orthogonal matrices. The
matrix D is dened to be a diagonal matrix.
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 26 / 32
2.8 Singular Value Decomposition
The left-singular vectors U are the eigenvectors of AAT . The
right-singular vectors V are the eigenvectors of AT A.The nonzero
singular values of A are the square roots of the eigenvalues of AT A
A = UDVT
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 27 / 32
2.9 The Moore-Penrose Pseudoinverse
Matrix inversion is not dened for matrices that are not square.
Suppose we want to make a left-inverse B of a matrix A so that we
can solve a linear equation
Ax = y
If A is taller than it is wide, then it is possible for this equation to
have no solution. If A is wider than it is tall, then there could be
multiple possible solutions
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 28 / 32
2.9 The Moore-Penrose Pseudoinverse
The Moore-Penrose pseudoinverse enables us to make some headway
in these cases. The pseudoinverse of A is dened as a matrix
A+
= lim
α 0
(AT
A + αI)−1
AT
Practical algorithms for computing the pseudoinverse are based not
on this denition, but rather on the formula.
A+
= VD+
UT
,
the pseudoinverse D+ of a diagonal matrix D is obtained by taking
the reciprocal of its nonzero elements then taking the transpose of
the resulting matrix
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 29 / 32
2.9 The Moore-Penrose Pseudoinverse
When A has more columns than rows, then solving a linear equation
using the pseudoinverse provides one of the many possible solutions.
Specically, it providesthe solution x = A+
y with minimal Euclidean
norm ||x||2 among all possible solutions.
When A has more rows than columns, it is possible for there to be no
solution.In this case, using the pseudoinverse gives us the x for which
Ax is as close as possible to y in terms of Euclidean norm ||Ax − y||2
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 30 / 32
2.10 The Trace Operator
TR(A) = i Ai,i
||A||F = TR(AAT
)
TR(A) = TR(AT
)
TR(ABC) = TR(CAB) = TR(BCA)
for A ∈ Rm×n and B ∈ Rn×m, TR(AB) = TR(BA)
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 31 / 32
2.11 The Determinant
The determinant of a square matrix, denoted det(A), is a function
that maps matrices to real scalars.
The determinant is equal to the product of all the eigenvalues of the
matrix. The absolute value of the determinant can be thought of as a
measure of how much multiplication by the matrix expands or
contracts space.
If the determinant is 0, then space is contracted completely along at
least one dimension, causing it to lose all its volume. If the
determinant is 1, then the transformation preserves volume
Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 32 / 32

Deep learning book_chap_02

  • 1.
    Deep Learning Book Chapter2 Hyeong Goo, Kang Uncoded 12kay226@gmail.com 2019-09-01 Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 1 / 32
  • 2.
    Overview 1 2.1 Scalars,Vectors, Matrices and Tensors 2 2.2 Multiplying Matrices and Vectors 3 2.3 Identity and Inverse Matrices 4 2.4 Linear Dependence and Span 5 2.5 Norms 6 2.6 Special Kinds of Matrices and Vectors 7 2.7 Eigendecomposition 8 2.8 Singular Value Decomposition 9 2.9 The Moore-Penrose Pseudoinverse 10 2.10 The Trace Operator 11 2.11 The Determinant Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 2 / 32
  • 3.
    2.1 Scalars, Vectors,Matrices and Tensors Scalars: A scalar is just a single number. we might say “s ∈ R” while defining a real-valued scalar, or “n ∈ N” while defining a natural number scalar Vectors: A vector is an array of numbers. The numbers are arranged in order. We can think of vectors as identifying points in space, with each element giving the coordinate along a dierent axis. x =      x1 x2 ... xn      Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 3 / 32
  • 4.
    2.1 Scalars, Vectors,Matrices and Tensors Figure: Scalar and Vector Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 4 / 32
  • 5.
    2.1 Scalars, Vectors,Matrices and Tensors Matrices: A matrix is a 2-D array of numbers, so each element is identified by two indices instead of just one. If a real-valued matrix mathbfA has a height of m and a width of n, then we say that A ∈ Rm×n x = A1,1 A1,2 A2,1 A2,2 Tensors: In some cases we will need an array with more than two axes. We identify the element of tensor at coordinates (i, j, k) by writing Ai,j,k Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 5 / 32
  • 6.
    2.1 Scalars, Vectors,Matrices and Tensors Add: We can add matrices to each other, as long as they have the same shape, just by adding their corresponding elements. C = A + B where Ci,j = Ai,j + Bi,j Multiply a scalar: We can multiply a scalar to a matrix. just by performing that operation on each element of a matrix.D = a · B where Di,j = a · Bi,j Transpose: AT i,j = Aj,i Broadcasting: In the context of deep learning, we also use some less conventional notation. C = A + b where Ci,j = Ai,j + bj Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 6 / 32
  • 7.
    2.2 Multiplying Matricesand Vectors Matrix product: The matrix product of matrices A and B is a third matrix C. In order for this product to be dened, A must have the same number of columns as B has rows. C = AB Ci,j = k Ai,kBk,j Dot product: between two vectors x and y of the same dimensionality is the matrix product xT · y Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 7 / 32
  • 8.
    2.2 Multiplying Matricesand Vectors Distributive property: A (B + C) = AB + AC Associative property: A (BC) = (AB) C Commutative property: Matrix multiplication is not commutative. However, the dot product between two vectors is commutative. xT · y = yT · x Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 8 / 32
  • 9.
    2.3 Identity andInverse Matrices Identity matrix: An identity matrix is a matrix that does not change any vector when we multiply that vector by that matrix. We denote the identity matrix that preserves n-dimensional vectors as In. Formally, In ∈ Rn×n and ∀x ∈ Rn, Inx = x Inverse Matrix: The matrix inverse of A is denoted as A−1 , and it is dened as the matrix such that A−1 A = In. If A have inverse matrix, We can solve Ax = b using the following steps. Ax = b A−1 Ax = A−1 b Inx = A−1 b x = A−1 b Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 9 / 32
  • 10.
    2.4 Linear Dependenceand Span For A−1 to exist, Ax = b must have exactly one solution for every value of b. It is also possible for the system of equations to have no solutions or innitely many solutions for some values of b. It is not possible, however, to have more than one but less than innitely many solutions for a particular b; if both x and y are solutions, z = αx + (1 − α)y is also a solution for any real α Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 10 / 32
  • 11.
    2.4 Linear Dependenceand Span A linear combination of some set of vectors v(1), . . . , v(n) is given by multiplying each vector v(i) by a corresponding scalar coecient and adding the results i ci v(i) The span of a set of vectors is the set of all points obtainable by linear combination of the original vectors Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 11 / 32
  • 12.
    2.4 Linear Dependenceand Span Determining whether Ax = b has a solution thus amounts to testing whether b is in the span of the columns of A. This particular span is known as the column space, or the range, of A Ax = i xi A:,i The system Ax = b to have a solution for all values of b ∈ Rn , we therefore require that the column space of A be all of Rm. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 12 / 32
  • 13.
    2.4 Linear Dependenceand Span The requirement that the column space of A be all of Rm implies immediately that A must have at least m columns, that is, n ≥ m. Having n ≥ m is only a necessary condition for every point to have a solution.It is not a sucient condition, because it is possible for some of the columns to be redundant. Formally, this kind of redundancy is known as linear dependence. A set of vectors is linearly independent if no vector in the set is a linear combination of the other vectors. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 13 / 32
  • 14.
    2.4 Linear Dependenceand Span matrix to have an inverse, we additionally need to ensure that equation Ax = b has at most one solution for each value of b. This means that the matrix must be square, that is, we require that m = n and that all the columns be linearly independent. A square matrix with linearly dependent columns is known as singular. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 14 / 32
  • 15.
    2.5 Norms Sometimes weneed to measure the size of a vector. In machine learning, we usually measure the size of vectors using a function called a norm. Formally, the Lp norm is given by ||x||p = ( i |xi |p ) 1 p for p ∈ R, p ≥ 1 Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 15 / 32
  • 16.
    2.5 Norms Norms, includingthe Lp norm, are functions mapping vectors to non-negative values. On an intuitive level, the norm of a vector x measures the distance from the origin to the point x. More rigorously, a norm is any function f that satises the following properties: f (x) = 0 ⇒ x = 0 f (x + y) ≤ f (x) + f (y) (the triangle inequality) α ∈ R, f (αx) = |α|f (x) Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 16 / 32
  • 17.
    2.5 Norms Figure: thetriangle inequality Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 17 / 32
  • 18.
    2.5 Norms The L2norm, with p = 2, is known as the Euclidean norm, which is simply the Euclidean distance from the origin to the point identied by x. The L2 norm is used so frequently in machine learning that it is often denoted simply as ||x||, with the subscript 2 omitted. The L1 norm is commonly used in machine learning when the dierence between zero and nonzero elements is very important. Every time an element of x moves away from 0 by , the L1 norm increases by Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 18 / 32
  • 19.
    2.5 Norms Sometimes wemay also wish to measure the size of a matrix. In the context of deep learning, the most common way to do this is with the Frobenius norm ||A||F = i,j |Ai,j |2) The dot product of two vectors can be rewritten in terms of norms xT y = ||x||2||y||2 cos θ Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 19 / 32
  • 20.
    2.6 Special Kindsof Matrices and Vectors Diagonal matrices consist mostly of zeros and have nonzero entries only along the main diagonal. Formally, a matrixDis diagonal if and only if Di,j = 0 for all i = j. We write diag(v) to denote a square diagonal matrix whose diagonal entries are given by the entries of the vector v. The inverse exists only if every diagonal entry is nonzero,and in that case, diag(v)−1 = diag([1/v1, . . . , 1/vn]T ) Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 20 / 32
  • 21.
    2.6 Special Kindsof Matrices and Vectors A symmetric matrix is any matrix that is equal to its own transpose: A = AT A unit vector is a vector with unit norm: ||A||2 = 1 A vector x and a vector y are orthogonal to each other if xT y = 0. If both vectors have nonzero norm, this means that they are at a 90 degree angle to each other. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 21 / 32
  • 22.
    2.6 Special Kindsof Matrices and Vectors If the vectors not only are orthogonal but also have unit norm, we call them orthonormal An orthogonal matrix is a square matrix whose rows are mutually orthonormal and whose columns are mutually orthonormal: AT A = AAT = I Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 22 / 32
  • 23.
    2.7 Eigendecomposition An eigenvectorof a square matrix A is a nonzero vector v such that multiplication by A alters only the scale of v: Av = λv The scalar λ is known as the eigenvalue corresponding to this eigenvector. If v is an eigenvector of A, then so is any rescaled vectors v for s ∈ R, s = 0 Moreover, sv still has the same eigenvalue. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 23 / 32
  • 24.
    2.7 Eigendecomposition Suppose thata matrix A has n linearly independent eigenvectors v(1), . . . , v(n) with corresponding eigenvalues λ1, . . . , λn. We may concatenate all the eigenvectors to form a matrix V with one eigenvector per column and the eigenvalues to form a vector λ A = Vdiag(λ)V−1 Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 24 / 32
  • 25.
    2.7 Eigendecomposition Specically, everyreal symmetric matrix can be decomposed into an expression using only real-valued eigenvectors and eigenvalues: A = QΛQT where Q is an orthogonal matrix composed of eigenvectors of A, and Λ is a diagonal matrix. A matrix whose eigenvalues are all positive is called positive denite. A matrix whose eigenvalues are all positive or zero valued is called positive semidenite. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 25 / 32
  • 26.
    2.8 Singular ValueDecomposition The singular vectorsandsingular values enables us to discover some of the same kind of information as the eigendecomposition reveals; however, the SVD is more generally applicable. Every real matrix has a singula rvalue decomposition, but the same is not true of the eigenvalue decomposition A = UDVT The matrices U and V are both dened to be orthogonal matrices. The matrix D is dened to be a diagonal matrix. Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 26 / 32
  • 27.
    2.8 Singular ValueDecomposition The left-singular vectors U are the eigenvectors of AAT . The right-singular vectors V are the eigenvectors of AT A.The nonzero singular values of A are the square roots of the eigenvalues of AT A A = UDVT Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 27 / 32
  • 28.
    2.9 The Moore-PenrosePseudoinverse Matrix inversion is not dened for matrices that are not square. Suppose we want to make a left-inverse B of a matrix A so that we can solve a linear equation Ax = y If A is taller than it is wide, then it is possible for this equation to have no solution. If A is wider than it is tall, then there could be multiple possible solutions Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 28 / 32
  • 29.
    2.9 The Moore-PenrosePseudoinverse The Moore-Penrose pseudoinverse enables us to make some headway in these cases. The pseudoinverse of A is dened as a matrix A+ = lim α 0 (AT A + αI)−1 AT Practical algorithms for computing the pseudoinverse are based not on this denition, but rather on the formula. A+ = VD+ UT , the pseudoinverse D+ of a diagonal matrix D is obtained by taking the reciprocal of its nonzero elements then taking the transpose of the resulting matrix Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 29 / 32
  • 30.
    2.9 The Moore-PenrosePseudoinverse When A has more columns than rows, then solving a linear equation using the pseudoinverse provides one of the many possible solutions. Specically, it providesthe solution x = A+ y with minimal Euclidean norm ||x||2 among all possible solutions. When A has more rows than columns, it is possible for there to be no solution.In this case, using the pseudoinverse gives us the x for which Ax is as close as possible to y in terms of Euclidean norm ||Ax − y||2 Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 30 / 32
  • 31.
    2.10 The TraceOperator TR(A) = i Ai,i ||A||F = TR(AAT ) TR(A) = TR(AT ) TR(ABC) = TR(CAB) = TR(BCA) for A ∈ Rm×n and B ∈ Rn×m, TR(AB) = TR(BA) Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 31 / 32
  • 32.
    2.11 The Determinant Thedeterminant of a square matrix, denoted det(A), is a function that maps matrices to real scalars. The determinant is equal to the product of all the eigenvalues of the matrix. The absolute value of the determinant can be thought of as a measure of how much multiplication by the matrix expands or contracts space. If the determinant is 0, then space is contracted completely along at least one dimension, causing it to lose all its volume. If the determinant is 1, then the transformation preserves volume Hyeong Goo, Kang (Uncoded) Deep Learning Book: chapter 2 2019-09-01 32 / 32