CS-813 Mathematical Methods for Computing
Lecture 1
Lecture 1
CS-813 Mathematical Methods for Computing
1 / 46
Mathematical Framework for Machine Learning
Lecture 1
CS-813 Mathematical Methods for Computing
2 / 46
Learning Roadmap
Linear Algebra
1
Solving linear equations, Linear
independence
2
Rank and subspaces
3
Norms, inner products, lengths
4
5
6
Probability and Statistics
1
Random variables, Bayes’ theorem
2
Poisson and Gaussian distributions
3
Multivariate distributions and maximum
likelihood method
Orthonormal basis, projections
4
Linear regression
Eigenvalues, eigenvectors, spectral
decomposition
5
Dimensionality reduction
6
Gaussian mixture model
Singular value decomposition and matrix
factorization
Lecture 1
Optimization
1
Gradient descent
2
Empirical Risk Minimization
CS-813 Mathematical Methods for Computing
3 / 46
Solving Linear Equations, Linear Independence
Mathematical Focus
Systems of linear equations
Matrix representation: Ax = b
Linear combinations and span
Linear dependence and independence
Main ML Connection
Representation of data using vectors and matrices
Neural-network layers as linear transformations
Parameter estimation and solving model equations
Lecture 1
CS-813 Mathematical Methods for Computing
4 / 46
Rank, Row Space and Column Space, Null Space, Subspaces
Mathematical Focus
Dimension of a vector space
Rank of a matrix
Fundamental subspaces
Relationships among rank, null spaces, and dimension
Main ML Connection
Identifying redundant features
Understanding the effective dimension of data
Detecting rank deficiency in data matrices
Feature-space representation
Lecture 1
CS-813 Mathematical Methods for Computing
5 / 46
Norms, Inner Products, Lengths and Distances
Mathematical Focus
Vector magnitude: ∥x∥
Inner product: ⟨x, y⟩
Euclidean distance
Angles and similarity between vectors
Main ML Connection
Measuring similarity between data points
Distance-based learning algorithms
Loss functions and error measurement
Regularization using vector norms
Lecture 1
CS-813 Mathematical Methods for Computing
6 / 46
Orthonormal Basis, Orthogonality, Projections
Mathematical Focus
Orthogonal and orthonormal vectors
Orthonormal coordinate systems
Projection of a vector onto a subspace
Least-squares approximation
Main ML Connection
Feature representation in orthogonal coordinates
Least-squares regression
Dimensionality reduction
Projection of high-dimensional data onto lower-dimensional spaces
Lecture 1
CS-813 Mathematical Methods for Computing
7 / 46
Eigenvalues, Eigenvectors, Spectral Decomposition
Mathematical Focus
Eigenvalue problem
Eigenvector directions and invariant subspaces
Diagonalization of matrices
Spectral decomposition
Main ML Connection
Principal Component Analysis (PCA)
Understanding covariance matrices
Spectral methods in machine learning
Analysis of data variance and dominant directions
Lecture 1
CS-813 Mathematical Methods for Computing
8 / 46
Singular Value Decomposition (SVD), Matrix Factorization, Low-Rank
Approximation
Mathematical Focus
Singular values and singular vectors
Matrix rank and low-rank approximation
General matrix factorization
Main ML Connection
PCA and dimensionality reduction
Data and image compression
Recommender systems
Latent feature representation
Noise reduction and matrix completion
Lecture 1
CS-813 Mathematical Methods for Computing
9 / 46
Random Variables and Bayes’ Theorem
Mathematical Focus
Probability
Conditional probability
Bayes rule
Main ML Connection
Probabilistic inference
Classification
Bayesian ML
Lecture 1
CS-813 Mathematical Methods for Computing
10 / 46
Poisson and Gaussian Distributions
Mathematical Focus
Probability distributions
Parameters
Moments
Main ML Connection
Noise modeling
Regression
Generative models
Lecture 1
CS-813 Mathematical Methods for Computing
11 / 46
Multivariate Distributions and Maximum Likelihood
Mathematical Focus
Joint distributions
Covariance
Likelihood
Main ML Connection
Parameter estimation
Probabilistic ML
Generative models
Lecture 1
CS-813 Mathematical Methods for Computing
12 / 46
Gradient Descent
Mathematical Focus
Gradients
Derivatives
Iterative optimization
Main ML Connection
Training neural networks and ML models
Lecture 1
CS-813 Mathematical Methods for Computing
13 / 46
Empirical Risk Minimization
Mathematical Focus
Loss functions
Empirical risk
Generalization
Main ML Connection
Fundamental principle of Supervised learning
Lecture 1
CS-813 Mathematical Methods for Computing
14 / 46
Linear Regression
Mathematical Focus
Least squares
Normal equations
Regression coefficients
Main ML Connection
Prediction
Supervised learning
Baseline models
Lecture 1
CS-813 Mathematical Methods for Computing
15 / 46
Dimensionality Reduction
Mathematical Focus
PCA
Projections
Low-dimensional representations
Main ML Connection
Feature extraction
Visualization
Preprocessing
Lecture 1
CS-813 Mathematical Methods for Computing
16 / 46
Gaussian Mixture Models
Mathematical Focus
Mixture distributions
Latent variable
Low-dimensional representations
Main ML Connection
Clustering
Generative learning
Lecture 1
CS-813 Mathematical Methods for Computing
17 / 46
Systems of Linear Equations
A linear equations in the variables x1 , x2 , . . . , xn :
a1 x1 + a2 x2 + · · · + an xn = b
where b and the coefficients a1 , a2 , . . . , an are real or complex numbers.
Example 1:
2x1 + 14x2 = 4
Example 2:
√
2 x1 + x2 = 3
A solution of a system is a list s1 , s2 , . . . , sn of numbers that makes each equation a true
statement when these values are substituted for x1 , x2 , . . . , xn , respectively.
Lecture 1
CS-813 Mathematical Methods for Computing
18 / 46
Systems of Linear Equations
Definition
The set of all possible solutions is called the solution set of the linear system. Two linear
systems are called equivalent if they have the same solution set.
Finding the solution set of a system of two linear equations in two variables is easy because it
amounts to finding the intersection of two lines. A typical problem is
x1 − 2x2 = −1, −x1 + 3x2 = 3
Lecture 1
CS-813 Mathematical Methods for Computing
19 / 46
Systems of Linear Equations
The graphs of these equations are lines, which we denote by l1 and l2 . The solution of both
equations lies on both lines (see figure)
Lecture 1
CS-813 Mathematical Methods for Computing
20 / 46
Systems of Linear Equations
Two lines need not intersect in a single point—they could be parallel, or they could coincide
and hence “intersect” at every point on the line.
Lecture 1
CS-813 Mathematical Methods for Computing
21 / 46
Systems of Linear Equations
A linear system can be written compactly in a rectangular array called a matrix
x1 − 2x2 + x3 = 0
2x2 − 8x3 = 8
5x1 − 5x3 = 10
with the coefficients of each variable aligned in columns, the matrix
⎡
⎤
1 2 1
⎣0 2 −8⎦
5 0 −5
is called the coefficient matrix (or matrix of coefficients) of the system, and the matrix
⎡
⎤
1 2 1
0
⎣0 2 −8 8 ⎦
5 0 −5 10
is called the augmented matrix of the system.
Lecture 1
CS-813 Mathematical Methods for Computing
22 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
23 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
24 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
25 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
26 / 46
Systems of Linear Equations
Definition
ELEMENTARY ROW OPERATIONS:
(Replacement) Replace one row by the sum of itself and a multiple of another row.
(Interchange) Interchange two rows.
(Scaling) Multiply all entries in a row by a nonzero constant.
Lecture 1
CS-813 Mathematical Methods for Computing
27 / 46
Systems of Linear Equations
A system is consistent if it has at least one solution while it may have more than one solutions.
Example
Determine if the following system is consistent:
x2 − 4x3 = 8
2x1 − 3x2 + 2x3 = 1
4x1 − 8x2 + 12x3 = 1
Lecture 1
CS-813 Mathematical Methods for Computing
28 / 46
Systems of Linear Equations
Definition
Row Reduction and Echelon Forms: A rectangular matrix is in echelon form (or row
echelon form) if it has the following three properties:
1. All nonzero rows are above any rows of all zeros.
2. Each leading entry of a row is in a column to the right of the leading entry of the row
above it.
3. All entries in a column below a leading entry are zeros.
If a matrix in echelon form satisfies the following additional conditions, then it is in reduced
echelon form (or reduced row echelon form):
4. The leading entry in each nonzero row is 1.
5. Each leading 1 is the only nonzero entry in its column.
Lecture 1
CS-813 Mathematical Methods for Computing
29 / 46
Systems of Linear Equations
Definition
Row Reduction and Echelon Forms: A rectangular matrix is in echelon form (or row
echelon form) if it has the following three properties:
1. All nonzero rows are above any rows of all zeros.
2. Each leading entry of a row is in a column to the right of the leading entry of the row
above it.
3. All entries in a column below a leading entry are zeros.
If a matrix in echelon form satisfies the following additional conditions, then it is in reduced
echelon form (or reduced row echelon form):
4. The leading entry in each nonzero row is 1.
5. Each leading 1 is the only nonzero entry in its column.
Lecture 1
CS-813 Mathematical Methods for Computing
30 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
31 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
32 / 46
Systems of Linear Equations
Definition
The variables x1 and x2 corresponding to pivot columns in the matrix are called basic
variables. The other variable, x3 , is called a free variable.
Lecture 1
CS-813 Mathematical Methods for Computing
33 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
34 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
35 / 46
Systems of Linear Equations
Definition
Existence and Uniqueness: A linear system is consistent if and only if the rightmost column
of the augmented matrix is not a pivot column—that is, if and only if an echelon form of the
augmented matrix has no row of the form
[0 . . . 0 b]
with b nonzero.
If a linear system is consistent, then the solution set contains either (i) a unique solution, when
there are no free variables, or (ii) infinitely many solutions, when there is at least one free
variable.
Lecture 1
CS-813 Mathematical Methods for Computing
36 / 46
Systems of Linear Equations
Definition
Vectors in R2 : A matrix with only one column is called a column vector or simply a vector
[︃ ]︃
2
−1
The set of all vectors with two entries is denoted by R2 (read “r-two”). The R stands for the
real numbers that appear as entries in the vectors, and the exponent 2 indicates that each
vector contains two entries.
Vectors in Rn :
⎡ ⎤
w1
⎢ w2 ⎥
⎢ ⎥
⎢ .. ⎥
⎣ . ⎦
wn
Lecture 1
CS-813 Mathematical Methods for Computing
37 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
38 / 46
Systems of Linear Equations
Definition
Linear Combinations: Given vectors v1 , v2 , . . . , vp in Rn and given scalars c1 , c2 , . . . , cp , the
vector y defined by
y = c1 v1 + c2 v2 + · · · + cp vp
is called a linear combination of v1 , v2 , . . . , vp with weights c1 , c2 , . . . , cp .
Lecture 1
CS-813 Mathematical Methods for Computing
39 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
40 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
41 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
42 / 46
Systems of Linear Equations
Definition
A vector equation
x1 a1 + x2 a2 + · · · + xn an = b
has the same solution set as the linear system whose augmented matrix is
[a1 a2 · · · an b]
In particular, b can be generated by a linear combination of a1 , a2 , . . . , an if and only if there
exists a solution to the linear system corresponding to the above matrix.
Lecture 1
CS-813 Mathematical Methods for Computing
43 / 46
Systems of Linear Equations
Definition
If v1 , v2 , . . . , vp are in Rn , then the set of all linear combinations of v1 , v2 , . . . , vp is denoted by
Span{v1 , v2 , . . . , vp } and is called the subset of Rn spanned (or generated) by v1 , v2 , . . . , vp .
That is, Span{v1 , v2 , . . . , vp } is the collection of all vectors that can be written in the form
c1 v1 + c2 v2 + · · · + cp vp
with c1 , c2 , . . . , cp scalars.
Lecture 1
CS-813 Mathematical Methods for Computing
44 / 46
Systems of Linear Equations
Asking whether a vector b is in Span{v1 , v2 , . . . , vp } amounts to asking whether the vector
equation
x1 v1 + x2 v2 + · · · + xp vp = b
has a solution, or, equivalently, asking whether the linear system with augmented matrix
[v1 v2 · · · vp b]
has a solution.
Lecture 1
CS-813 Mathematical Methods for Computing
45 / 46
Systems of Linear Equations
Lecture 1
CS-813 Mathematical Methods for Computing
46 / 46
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )