mathematics needed for deep learning ai part 1 | DEEP LEARNING ( AI ) FOR BEGINNERS AND CODERS | MULTIPLEWORDS BY PROGRAMMERS

Deep learning is a numerical computation programming means program are written and executed using help from mathematics and formulating our idea through mathematics. Every research in science field have to be proved through mathematics formulation. Deep learning uses very basic mathematics to evaluate and write program. Deep learning resolve around statics's, probabilities, VECTORS, MATRICES and Linear equation domain of mathematics. This series of blog generally written for people and students who are interested in deep learning but doesn't know much about mathematics. If you know field mentioned above you can skip this blog.

Deep learning programming uses the power of mathematics and programming to give you result. You need to know both mathematics and programming in any language. We have also covered basic programming needed for deep learning. You can find on our websites.

Basic mathematical entities used in deep learning are Vectors, Mean, Standard deviation, Linear equation and graph. We will discuss this topics and will provide equivalent python code to run in google colab to see its effect and feel the power of programmer.


This is mathematical term used to express distance in physics with direction. Means it is a variable having its scalar quantity and its direction. Lets say in physics velocity is a vector because it contains direction in which vehicle is moving and speed through which it is moving.

In deep learning vectors are used as some features of input which have direction will be considered as vector. Don't worry if didn't get it for the first time because I to didn't get it. You can consider it as a bunch number in which each number is a feature vector for now

Consider above expression as a bunch of vector in which each number is considered it as vectors. In deep learning vector are some times called as tensor array, so don't confuse by these words. If you find it somewhere you can express such bunch of numbers in numpy array in python. Just open below link for seeing vector in numpy array in google colab.

import numpy as np


print (a)


Mean generally is an average of numbers. It is number which represent full sets of numbers. In India we use percentage system to quantify students performance exam. Let say student got 60 Marks in Maths, 70 Marks in English and 80 marks in Hindi. so ttake average for this we need to add all subject marks and divide it with total numbers of subjects. Let say we have (70+60+80)/'3 = 70. Student got 70 Marks on an average.

We can consider MEAN as a number which represents that bunch of numbers. In our vector example we have taken bunch of number as [5 6 7 8]

We take an average for this which will be

Average = ( 5+6+7+8 ) / 4

Average 6.5

In PYTHON we write like this .Just open below link for seeing vector in numpy array in google colab.

import numpy as np

a = np.mean ([5,6,7,8])

mean = np.mean (a)



It is technique to find out in which range from mean maximum item exists. It is number calculated from mean. Lets consider we have five dogs with heights [ 5,6,7,8,9]. To find standard deviation first we have find out mean from this number which will be

mean = (95+6+7+8+9) /5

mean = 7

mean height = 7

Then we have to find how much dog heights is away from average dog heights

dog 1 = 7 - 5 = 2

dog 2 = 7 - 6 = 1

dog 3 = 7 - 7 = 0

dog 4 = 8 - 7 = 1

dog 5 = 9 - 7 =2

Then we add all dogs distance from mean and divide by total number of dogs.

Standard deviation = 2+1+0+1+2 / 5

SD = 1.2


A Matrices is a bunch of number written in row and column fashion to represent certain quantities which are independent. Matrices can be written as -

The above matrices is called 3x4 matrices. In which there are three rows and 4 columns are there. Let say each row represent some food items price and each column represent on same day. Let say Monday, Tuesday, Wednesday, Thursday and each row represent rice, wheat, cereal price for that day. Matrix than be written as

Matrix is just representation of number in row, column format. You can perform different type of matrice operation to the matrix which can be addition, subtraction, scalar multiplication and matrix multiplication. You can find all operational detail of matrices in this link.

Matrices have two properties row and column and matrices can be used to represent different type of vectors.

Matrices are highly used in deep learning because of its nature to represent complex number structure. Matrices can be used to represent different inputs of higher dimensions. Matrices can also be used to represent and perform Linear equation in efficient way. Matrices in deep learning are generally referred to as numpy array. Numpy array have a shape and perform all matrix operation. Let say if you want to represent above given matrices

Run above two function in google colab to see shape and type of numpy array or matrices. Matrices in numpy array can be increased to any dimensions

Numpy array also supports broad casting which means it can copy all its value to its nearby place to fill operation requirement of shape.


In this we have seen Vectors, Mean, Standard deviation in details and also discuss Matrices. In covering past in deep learning for Maths part 2. We will discuss Graph, Linear equation,Matrices operation.If you have any query or feedback or need any help regarding boiler code of any topic , you can freely ask in comments. I would really love to help you

taher AI Professional

Related Posts