Matrices and Artificial Intelligence

Rupika Nimbalkar
appengine.ai
Published in
3 min readJun 15, 2021

Matrices with their different branches are helping in delivering better models for AI

Matrices are useful in expressing numerical information in the enclosed form. they are extremely useful in expressing different operators. functions such as linear maps are represented by matrices. depending upon the operation they are extremely important in physical science, economics, statistics, machine learning, and computer science. matrices also play an important part in 3D computer graphics because of their potential in encoding a few geometric operations like rotation, reflection, and transformation. in simpler language we can say that concept of matrices can be used in graphics to deliver a better image. Thus we can say that the basic concepts of mathematics are helping modern technology like AI to deliver better. This helps to make it more convenient for platforms like appengine.ai to deliver good products and services.

Matrices

A rectangular arrangement of mn numbers in m rows and n columns, enclosed in [ ] is said to be matrices of order m by n.it is denoted by m x n.in general matrices of order m x n are represented by

Few types of matrices that play an important role in machine learning are

Algebra of matrices

Here we shall see three basic algebras of matrix Python using NumPy array.

Addition of matrices:

Two matrices A and B are of the same order. their addition is denoted by A + B is the matrix obtained by corresponding elements of A and B.

example,

# add matrix

From numpy import array

A = array([[2, 3, 1], [-1, -2, 0]])

print(A)

B = array([[-4, 3, 1], [5, 7, -8]])

print(B)

C = A + B

print(C)

Running the example

[[ -2 6 2]

[ 5 7 -8]]

Subtraction of matrices:

Two matrices A and B are of the same order. their subtraction is denoted by A — B is the matrix obtained by corresponding elements of A and B.

example,

# subtract matrix

From numpy import array

A = array([[8, 5, 1], [7, 9, 9]])

print(A)

B = array([[4, 3, 0], [5, 7, 8]])

print(B)

C = A — B

print(C)

Running the example

[[ 4 2 1]

[ 2 2 1]]

Multiplication of a Matrices by a scalar:

If A is any matrix and k is a scalar, then the matrix obtained by multiplying each element of A by the scalar k is called scalar multiple of the given matrix A and is denoted by kA.

# matrix-scalar multiplication

From numpy import array

A = array([[-1, 5], [3, -2], [4, 7]])

print(A)

k = 3/2

print(k)

C = k * A

print(C)

Running the example

[[ -3/2 15/2 ]

[ 9/2 -3 ]

[ 6 21/2 ]]

--

--