Deep learning is a type of machine learning and **artificial intelligence **that mimics the way the human mind learns a particular subject. This type of learning is one of the important elements in data science, which includes statistics and predictive modeling. Deep learning is very useful for data scientists who are tasked with collecting, analyzing, and interpreting large amounts of data, making the process faster and easier.

In a way, it can be said that deep learning is the same as machine learning in such a way that it performs learning for the machine at the level of complex tasks, representation, or abstraction, and in this way, the machine gets a better understanding of the realities of existence and can identify different patterns. At its simplest level, deep learning can be seen as a way to automate the analysis of predictions. Deep learning algorithms are in the hierarchy of increasing complexity and abstraction, while traditional machine learning is linear.

The role of mathematics and algebra in the field of deep learning is very evident. In the following article, we will examine the application of mathematics in deep learning. Also, by stating the topics in mathematics that form its main basis, we clarify its application in the science of deep learning.

Learning many scientific topics requires learning the basic knowledge related to them. Artificial intelligence and machine learning are among the sciences that have attracted many enthusiasts in various fields these days. Like other fields of knowledge, learning these topics requires learning prerequisites that can even be said to be an inseparable part of them. Perhaps the first field that comes to people’s minds to learn as a prerequisite or co-requirement for artificial intelligence is programming languages.

Therefore, in the discussion of deep learning, as one of the sub-branches of artificial intelligence related to the discussion of artificial neural networks, there is a need to learn some concepts of linear algebra, especially topics related to vectors, matrices, and operations on them. Linear algebra is the continuous form of discrete mathematics that most computer scientists are familiar with. A deep understanding of this science is required to learn and work with **machine learning algorithms.**

Table of Contents

## Why is mathematics important in deep learning?

Linear algebra, probabilities, and calculus are the languages that machine learning has been formulated using. Learning these topics leads to a deep understanding of the mechanism of existing algorithms and the construction of new algorithms. Behind deep learning algorithms are also concepts of linear algebra, and therefore, these concepts must be learned before learning and implementing them with programming languages. Scalars, vectors, matrices, and tensors form the basic constructs in deep learning. In the following, each of these concepts is explained.

## Quantity

Quantity is the amount of something that is measured or counted. In other words, the amount, size, and number of something are called its quantity. Quantity and value are two synonyms. Quantities are divided into two types of fences (scalar or numerical) and vectors.

## Quantity of fences

A scalar quantity is represented by a number. For example, the distance between two points (five meters) is a fence quantity. Unlike vector quantities, lattice quantities have no direction. The fence quantity is a zero-order tensor. Mass, energy, temperature, and density can be mentioned among other fence quantities. The statement x ∈ ℝ implies that x is a scalar quantity belonging to the set of real numbers ℝ.

Various datasets are used in deep learning. ℕ is a data set of positive integers (…, 1, 2, 3) and ℤ is a set of positive, negative, and zero integers. ℚ is a set of rational numbers expressed as a fraction of two integers. Among the scalars available in Python, we can mention integer, float, byte, and Unicode. In Python’s **NumPy library**, 24 basic data types are available to define scalar types.

## Vector quantity

A quantity defined by several scalars (for example, size and direction) is called a vector. Vectors are ordered arrays of numbers. A vector is an example of a first-order tensor. The vectors themselves are part of what is known as a vector space. A vector space can be thought of as the set of all possible vectors of a given length (or dimension). A three-dimensional vector space valued with real numbers is denoted as ℝ^3 and is often used as a real-world representation of three-dimensional space mathematically.

To explain the necessary components to express a vector, the i-th component of the vector is written as [x[i.

In deep learning, vectors are usually used to represent the feature vector that shows the degree of relevance of a certain feature with its main components. The feature vector can include the intensity importance of a set of pixels in a two-dimensional space, an image, or a history of price values in financial instruments.

## Matrix

Matrices are rectangular arrays of numbers and are second-order tensors. If we consider m and n to be positive integers, where m, n ∈ ℕ, then the m×n matrix contains m*n numbers with m rows and n columns.

In the Python programming language, the Numpy library is used, which allows the creation of n-dimensional arrays, which are matrices. Using the list method and passing in lists, you can define a matrix.

## Tensors

Tensor is a geometric element that is used in mathematics to develop the concepts of scalar quantities, vectors, and matrices. A tensor is an array of numbers placed in a table. Tensor in its simplest case has one member, which is the scalar quantity. In more advanced form, the first-order tensor is an array of numbers. Tensors with two or more dimensions are known as matrices. In machine learning, it is sometimes necessary to use tensors with an order higher than two. Instead of using nested matrices, you can use the Tensorflow or PyTorch library to declare tensors.