LINEAR ALGEBRA (Part-2) - Multiplying Matrices

LINEAR ALGEBRA (Part-2)

Multiplying Matrices

Standard Calculation

We can add, subtract, divide or multiply a matrix with a scalar value. These operations will be element wise. Let's consider a 3✖2 Matrix A3,2. See below.
A3,2 = [                           
12                           
23                           
31                           
]                           

Let's add a scalar value 5 with it.

A3,2 =[A3,2 =A3,2 =[
125✚1 5✚2 67
523

=

 5✚25✚3 

=

78
315✚3 5✚1 86
]]

Let's subtract a scalar value 5 with it.

A3,2 =[A3,2 =A3,2 =[
125➖1 5➖2 43
523

=

 5➖25➖3 

=

32
315➖3 5➖1 24
]]

Let's multiply a scalar value 5 with it.

A3,2 =[A3,2 =A3,2 =[
125❌1 5❌2 510
523

=

5❌25❌3 

=

1015
315❌3 5❌1 155
]]

Let's divide a scalar value 5 with it.

A3,2 =[A3,2 =A3,2 =[
125➗1 5➗2   5 2.5
523

=

5➗25➗3 

=

 2.51.67
315➗3 5➗1 1.67  5
]]

Standard Multiplication

It is also called Standard Product. The standard multiplication of matrix A and B will be another matrix C. Matrix are represented by row ✖ column. If matrix A is 3✖2 and B is 3✖2 then resultant matrix C will also be 3✖2 matrix. We can represent it by C3,2 = A3,2 ⊙ B3,2
For standard multiplication both matrix have to be of same size. It will be a element wise multiplication. Lets see below
A3,2 =[B3,2 =[C3,2 =A3,2 =[
4124❌1 5❌2 410
5623

=

5❌26❌3 

=

1018
6316❌3 4❌1 184
]]]

Similarly we can also do addition, subtration and division also.

Matrix Multiplication

It is also called Matrix Product. The multiplication of matrix A and B will be another matrix C. Matrix are represented by row ✖ column. If matrix A is 3✖2 and B is 2✖4 then resultant matrix C will be 3✖4 matrix. We can represent it by C3,4 = AB
For Matrix Multiplication the column size of one matrix have to be equal to row size of another matrix and vice versa. Let's see the multiplication below.
A3,2 =[B2,3 =[C3,3 =A3,3 =[
41234❌1 ➕ 5❌2    4❌2 ➕ 5❌3    4❌3 ➕ 5❌1142317
56231

=

5❌1 ➕ 6❌25❌2 ➕ 6❌35❌3 ➕ 6❌3

=

172833
66❌1 ➕ 4❌26❌2 ➕ 4❌36❌1 ➕ 4❌1142410
]]

SOURCE

Deep Learning (Ian Goodfellow, Yoshua Bengio, Aaron Courville)

মন্তব্যসমূহ

এই ব্লগটি থেকে জনপ্রিয় পোস্টগুলি

What Is derivative? (Part - 1)

LINEAR ALGEBRA (Part-1) - Scalars, Vectors, Matrices and Tensors