본문 바로가기
Coursera/Mathematics for ML and Data Science

Linear Algebra for Machine Learning and Data Science (11)

by Fresh Red 2024. 5. 16.
728x90
반응형

Vectors and Linear Transformations

Linear Transformations

Matrices as linear transformations

A linear transformation is a way to send each point in the plane into another point in a very structured way

012
Linear transformation

So with the given square on a plane, we apply the dot product of each point to a matrix and get a transformed matrix

Linear transformations as matrices

012
Finding the elements of the matrix

If the elements of the matrix are unknown and the coordinates of two figures on the plane are known, the first column of a matrix will be the linearly transformed vector from (1, 0) and the second column will be the linearly transformed vector from (0, 1)

 

Matrix multiplication

Matrix multiplication corresponds to combining two linear transformations into a third one

012345
How a matrix multiplication is done
Try to solve this

What value will be in the cell in the bottom left corner of this matrix after completing the multiplication?

더보기

1

You need to take the dot product of the second row of the first matrix, and the first column of the second matrix. (2 * 3) + (-1 * 1) + (2 * -2) = 6 - 1 - 4 = 1.

Some rules for applicable matrix multiplication

The identity matrix

The identity matrix is a matrix with the diagonal values as 1 and the rest as 0

When a linear transformation is performed to another vector/matrix, it returns the same one

01
Identity matrix and its linear transformation

Matrix inverse

The inverse of a matrix is like the inverse of a number; when we multiply the original by the inverse, we get the identity matrix (matrix with all 0s except the diagonals are all 1s)

In linear transformation, the inverse undoes the transformation that the original matrix did (returns the plane to where it was at the beginning)

01
Inverse matrix
To find the inverse matrix

We can find the inverse matrix by solving the system of linear equations

Find the inverse of the following matrix

Answer

더보기

a = 1/4

b = -1/4

c = -1/8

d = 5/8

Find the inverse of the following matrix

Answer

더보기

No solution

Which matrices have an inverse?

Not all matrices have an inverse

Singular matrices don’t have an inverse

We also know that the determinants of singular matrices are 0

Neural networks and matrices

Which of the following options is a correct set of points and threshold for the proposed problem?

  1. Lottery: 1 point. Win: 1 point. Threshold: 1.5 points.
  2. Lottery: 1 point. Win: 2 points. Threshold: 3 points.
  3. Lottery: 2 points. Win: 3 points. Threshold: 1.5 points.
더보기

1

Correct! The proposed solution correctly explains every case in the dataset.

012345

We can think of the machine learning model as the matrix multiplication of data columns with the model (weights) and the output is determined based on whether it is over the threshold or not

This process is also called a perceptron

0123
The AND operator and the perceptron

This can be seen with the AND operator and the visualization of the perceptron

 

All the information here is based on the Linear Algebra for Machine Learning and Data Science | Coursera from DeepLearning.AI

728x90
반응형

home top bottom
}