SlideShare a Scribd company logo
2
Most read
6
Most read
8
Most read
Linear Algebra for
Deep Learning
Introduction
• Linear Algebra is a continuous form of mathematics and also central
to almost all areas of mathematics like geometry and functional
analysis.
• In Linear Algebra, data is represented by linear equations, which are
presented in the form of matrices and vectors.
Mathematical Objects
Scalar: A scalar is simply a single number. For example 24.
Vector
• A Vector is an ordered array of numbers and can be in a row or a
column. A Vector has just a single index, which can point to a specific
value within the Vector. For example, V2 refers to the second value
within the Vector
Matrix
• A Matrix is an ordered 2D array of numbers and it has two indices. The first one
points to the row and the second one to the column. For example, M23 refers to
the value in the second row and the third column. A Matrix can have multiple
numbers of rows and columns. Note that a Vector is also a Matrix, but with only
one row or one column.
Tensor
• A Tensor is an array of numbers, arranged on a regular grid, with a variable
number of axes. A Tensor has three indices, where the first one points to the row,
the second to the column and the third one to the axis. For example, T232 points
to the second row, the third column, and the second axis. This refers to the value
0 in the right Tensor in the graphic below:
Contd…
• Tensor is the most general term for all of these concepts above
because a Tensor is a multidimensional array and it can be a Vector
and a Matrix, depending on the number of indices it has. For
example, a first-order Tensor would be a Vector (1 index). A second-
order Tensor is a Matrix (2 indices) and third-order Tensors (3 indices)
and higher are called Higher-Order Tensors (3 or more indices).
Computational Rules
1. Matrix-Scalar Operations
• If you multiply, divide, subtract, or add a Scalar to a Matrix, you do so
with every element of the Matrix. The image below illustrates this
perfectly for multiplication:
2. Matrix-Vector Multiplication
• Multiplying a Matrix by a Vector can be thought of as multiplying each row of the
Matrix by the column of the Vector. The output will be a Vector that has the same
number of rows as the Matrix. The image below shows how this works:
3. Matrix-Matrix Addition and Subtraction
• Matrix-Matrix Addition and Subtraction is fairly easy and straightforward. The
requirement is that the matrices have the same dimensions and the result is a
Matrix that has also the same dimensions. You just add or subtract each value of
the first Matrix with its corresponding value in the second Matrix. See below:
4. Matrix-Matrix Multiplication
• Multiplying two Matrices together isn’t that hard either if you know how to
multiply a Matrix by a Vector. Note that you can only multiply Matrices together if
the number of the first Matrix’s columns matches the number of the second
Matrix’s rows. The result will be a Matrix with the same number of rows as the
first Matrix and the same number of columns as the second Matrix.
Matrix Multiplication Properties
• Matrix Multiplication has several properties that allow us to bundle a
lot of computation into one Matrix multiplication. We will discuss
them one by one below. We will start by explaining these concepts
with Scalars and then with Matrices because this will give you a better
understanding of the process.
1. Not Commutative
• Scalar Multiplication is commutative but Matrix Multiplication is not. This
means that when we are multiplying Scalars, 7*3 is the same as 3*7. But
when we multiply Matrices by each other, A*B isn’t the same as B*A.
2. Associative
• Scalar and Matrix Multiplication are both associative. This means that the
Scalar multiplication 3(5*3) is the same as (3*5)3 and that the Matrix
multiplication A(B*C) is the same as (A*B)C.
3. Distributive
• Scalar and Matrix Multiplication are also both distributive. This means that
3(5 + 3) is the same as 3*5 + 3*3 and that A(B+C) is the same as A*B + A*C.
4. Identity Matrix
• The Identity Matrix is a special kind of Matrix but first, we need to define what an
Identity is. The number 1 is an Identity because everything you multiply with 1 is
equal to itself. Therefore every Matrix that is multiplied by an Identity Matrix is
equal to itself. For example, Matrix A times its Identity-Matrix is equal to A.
• You can spot an Identity Matrix by the fact that it has ones along its diagonals and
that every other value is zero. It is also a “squared matrix,” meaning that its
number of rows matches its number of columns.

More Related Content

What's hot (20)

PPT
Graph colouring
Priyank Jain
 
PPT
3.Fixed-Floating Point.ppt
RavikumarR77
 
PPT
Predicates and Quantifiers
blaircomp2003
 
PPTX
Representation of Integers
Susantha Herath
 
PPT
Error detection and correction codes
GargiKhanna1
 
PPT
Graph isomorphism
Core Condor
 
PDF
Binary Arithmetic Operations
Digital System Design
 
PPT
Taylor series and maclaurin with exercices
HernanFula
 
PPTX
Unsigned and Signed fixed point Addition and subtraction
ciyamala kushbu
 
PPTX
Time series predictions using LSTMs
Setu Chokshi
 
PPSX
Fixed point and floating-point numbers
MOHAN MOHAN
 
PPT
binary arithmetic rules
student
 
PPT
Minterm and maxterm
parsa.khan64
 
PPTX
P np & np completeness
Anwal Mirza
 
PPTX
Big o notation
hamza mushtaq
 
PPTX
Hamiltonian path
Arindam Ghosh
 
PPTX
Exhaustive Search
Kasun Ranga Wijeweera
 
PPT
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Mohanlal Sukhadia University (MLSU)
 
PPT
Predicate Logic
giki67
 
PPTX
Binomial Coefficient
Vikshit Ganjoo
 
Graph colouring
Priyank Jain
 
3.Fixed-Floating Point.ppt
RavikumarR77
 
Predicates and Quantifiers
blaircomp2003
 
Representation of Integers
Susantha Herath
 
Error detection and correction codes
GargiKhanna1
 
Graph isomorphism
Core Condor
 
Binary Arithmetic Operations
Digital System Design
 
Taylor series and maclaurin with exercices
HernanFula
 
Unsigned and Signed fixed point Addition and subtraction
ciyamala kushbu
 
Time series predictions using LSTMs
Setu Chokshi
 
Fixed point and floating-point numbers
MOHAN MOHAN
 
binary arithmetic rules
student
 
Minterm and maxterm
parsa.khan64
 
P np & np completeness
Anwal Mirza
 
Big o notation
hamza mushtaq
 
Hamiltonian path
Arindam Ghosh
 
Exhaustive Search
Kasun Ranga Wijeweera
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Mohanlal Sukhadia University (MLSU)
 
Predicate Logic
giki67
 
Binomial Coefficient
Vikshit Ganjoo
 

Similar to Linear algebra for deep learning (20)

PPTX
Brief review on matrix Algebra for mathematical economics
felekephiliphos3
 
PPTX
Matlab ch1 (4)
mohsinggg
 
PPTX
Alg II Unit 3-6-solvingsystemsmatrices
jtentinger
 
PPTX
Alg II 3-6 Solving Systems - Matrices
jtentinger
 
PPT
Matrix and its applications by mohammad imran
Mohammad Imran
 
PDF
1 linear algebra matrices
AmanSaeed11
 
PPT
Matrix Algebra : Mathematics for Business
Khan Tanjeel Ahmed
 
PPTX
Matrices and determinants
som allul
 
PPTX
introduction-MATRIX-algebramathematics .pptx
AngeliqueVicente3
 
PPTX
Matrices
kja29
 
PPTX
Presentation.pptx
AMANPATHAK87
 
PPTX
Linear Algebra presentation.pptx
ProveedorIptvEspaa
 
PPTX
Fundamentals of Machine Learning.pptx
WiamFADEL
 
PPTX
DSA Project Slides in computer science.pptx
umairmalik9090
 
PPTX
Mat lab.pptx
MeshackDuru
 
PDF
Matrices
ble nature
 
PPTX
matrix algebra
kganu
 
PPTX
Introduction to matices
Raza Tuition center
 
DOCX
Application of matrices in real life
X-Ʀǿmặŋtiç ßǿy-ẌǷƿ
 
PPTX
Vector and Matrix operationsVector and Matrix operations
ssuser2624f71
 
Brief review on matrix Algebra for mathematical economics
felekephiliphos3
 
Matlab ch1 (4)
mohsinggg
 
Alg II Unit 3-6-solvingsystemsmatrices
jtentinger
 
Alg II 3-6 Solving Systems - Matrices
jtentinger
 
Matrix and its applications by mohammad imran
Mohammad Imran
 
1 linear algebra matrices
AmanSaeed11
 
Matrix Algebra : Mathematics for Business
Khan Tanjeel Ahmed
 
Matrices and determinants
som allul
 
introduction-MATRIX-algebramathematics .pptx
AngeliqueVicente3
 
Matrices
kja29
 
Presentation.pptx
AMANPATHAK87
 
Linear Algebra presentation.pptx
ProveedorIptvEspaa
 
Fundamentals of Machine Learning.pptx
WiamFADEL
 
DSA Project Slides in computer science.pptx
umairmalik9090
 
Mat lab.pptx
MeshackDuru
 
Matrices
ble nature
 
matrix algebra
kganu
 
Introduction to matices
Raza Tuition center
 
Application of matrices in real life
X-Ʀǿmặŋtiç ßǿy-ẌǷƿ
 
Vector and Matrix operationsVector and Matrix operations
ssuser2624f71
 
Ad

Recently uploaded (20)

PPTX
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
PDF
apidays Munich 2025 - The Double Life of the API Product Manager, Emmanuel Pa...
apidays
 
PPTX
The whitetiger novel review for collegeassignment.pptx
DhruvPatel754154
 
PPTX
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
PDF
WISE main accomplishments for ISQOLS award July 2025.pdf
StatsCommunications
 
PDF
McKinsey - Global Energy Perspective 2023_11.pdf
niyudha
 
PDF
SUMMER INTERNSHIP REPORT[1] (AutoRecovered) (6) (1).pdf
pandeydiksha814
 
PDF
717629748-Databricks-Certified-Data-Engineer-Professional-Dumps-by-Ball-21-03...
pedelli41
 
PDF
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
PPTX
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
PDF
blockchain123456789012345678901234567890
tanvikhunt1003
 
PDF
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
HSE WEEKLY REPORT for dummies and lazzzzy.pptx
ahmedibrahim691723
 
PDF
202501214233242351219 QASS Session 2.pdf
lauramejiamillan
 
PPTX
Pipeline Automatic Leak Detection for Water Distribution Systems
Sione Palu
 
PDF
Classifcation using Machine Learning and deep learning
bhaveshagrawal35
 
PPTX
lecture 13 mind test academy it skills.pptx
ggesjmrasoolpark
 
PPTX
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
PPTX
short term internship project on Data visualization
JMJCollegeComputerde
 
PPTX
Presentation (1) (1).pptx k8hhfftuiiigff
karthikjagath2005
 
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
apidays Munich 2025 - The Double Life of the API Product Manager, Emmanuel Pa...
apidays
 
The whitetiger novel review for collegeassignment.pptx
DhruvPatel754154
 
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
WISE main accomplishments for ISQOLS award July 2025.pdf
StatsCommunications
 
McKinsey - Global Energy Perspective 2023_11.pdf
niyudha
 
SUMMER INTERNSHIP REPORT[1] (AutoRecovered) (6) (1).pdf
pandeydiksha814
 
717629748-Databricks-Certified-Data-Engineer-Professional-Dumps-by-Ball-21-03...
pedelli41
 
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
blockchain123456789012345678901234567890
tanvikhunt1003
 
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
HSE WEEKLY REPORT for dummies and lazzzzy.pptx
ahmedibrahim691723
 
202501214233242351219 QASS Session 2.pdf
lauramejiamillan
 
Pipeline Automatic Leak Detection for Water Distribution Systems
Sione Palu
 
Classifcation using Machine Learning and deep learning
bhaveshagrawal35
 
lecture 13 mind test academy it skills.pptx
ggesjmrasoolpark
 
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
short term internship project on Data visualization
JMJCollegeComputerde
 
Presentation (1) (1).pptx k8hhfftuiiigff
karthikjagath2005
 
Ad

Linear algebra for deep learning

  • 2. Introduction • Linear Algebra is a continuous form of mathematics and also central to almost all areas of mathematics like geometry and functional analysis. • In Linear Algebra, data is represented by linear equations, which are presented in the form of matrices and vectors.
  • 3. Mathematical Objects Scalar: A scalar is simply a single number. For example 24.
  • 4. Vector • A Vector is an ordered array of numbers and can be in a row or a column. A Vector has just a single index, which can point to a specific value within the Vector. For example, V2 refers to the second value within the Vector
  • 5. Matrix • A Matrix is an ordered 2D array of numbers and it has two indices. The first one points to the row and the second one to the column. For example, M23 refers to the value in the second row and the third column. A Matrix can have multiple numbers of rows and columns. Note that a Vector is also a Matrix, but with only one row or one column.
  • 6. Tensor • A Tensor is an array of numbers, arranged on a regular grid, with a variable number of axes. A Tensor has three indices, where the first one points to the row, the second to the column and the third one to the axis. For example, T232 points to the second row, the third column, and the second axis. This refers to the value 0 in the right Tensor in the graphic below:
  • 7. Contd… • Tensor is the most general term for all of these concepts above because a Tensor is a multidimensional array and it can be a Vector and a Matrix, depending on the number of indices it has. For example, a first-order Tensor would be a Vector (1 index). A second- order Tensor is a Matrix (2 indices) and third-order Tensors (3 indices) and higher are called Higher-Order Tensors (3 or more indices).
  • 8. Computational Rules 1. Matrix-Scalar Operations • If you multiply, divide, subtract, or add a Scalar to a Matrix, you do so with every element of the Matrix. The image below illustrates this perfectly for multiplication:
  • 9. 2. Matrix-Vector Multiplication • Multiplying a Matrix by a Vector can be thought of as multiplying each row of the Matrix by the column of the Vector. The output will be a Vector that has the same number of rows as the Matrix. The image below shows how this works:
  • 10. 3. Matrix-Matrix Addition and Subtraction • Matrix-Matrix Addition and Subtraction is fairly easy and straightforward. The requirement is that the matrices have the same dimensions and the result is a Matrix that has also the same dimensions. You just add or subtract each value of the first Matrix with its corresponding value in the second Matrix. See below:
  • 11. 4. Matrix-Matrix Multiplication • Multiplying two Matrices together isn’t that hard either if you know how to multiply a Matrix by a Vector. Note that you can only multiply Matrices together if the number of the first Matrix’s columns matches the number of the second Matrix’s rows. The result will be a Matrix with the same number of rows as the first Matrix and the same number of columns as the second Matrix.
  • 12. Matrix Multiplication Properties • Matrix Multiplication has several properties that allow us to bundle a lot of computation into one Matrix multiplication. We will discuss them one by one below. We will start by explaining these concepts with Scalars and then with Matrices because this will give you a better understanding of the process.
  • 13. 1. Not Commutative • Scalar Multiplication is commutative but Matrix Multiplication is not. This means that when we are multiplying Scalars, 7*3 is the same as 3*7. But when we multiply Matrices by each other, A*B isn’t the same as B*A. 2. Associative • Scalar and Matrix Multiplication are both associative. This means that the Scalar multiplication 3(5*3) is the same as (3*5)3 and that the Matrix multiplication A(B*C) is the same as (A*B)C. 3. Distributive • Scalar and Matrix Multiplication are also both distributive. This means that 3(5 + 3) is the same as 3*5 + 3*3 and that A(B+C) is the same as A*B + A*C.
  • 14. 4. Identity Matrix • The Identity Matrix is a special kind of Matrix but first, we need to define what an Identity is. The number 1 is an Identity because everything you multiply with 1 is equal to itself. Therefore every Matrix that is multiplied by an Identity Matrix is equal to itself. For example, Matrix A times its Identity-Matrix is equal to A. • You can spot an Identity Matrix by the fact that it has ones along its diagonals and that every other value is zero. It is also a “squared matrix,” meaning that its number of rows matches its number of columns.