The math of NNs
In the following few sections, we’ll discuss the mathematical principles of NNs. This way, we’ll be able to explain NNs through these very principles in a fundamental and structured way.
Linear algebra
Linear algebra deals with objects such as vectors and matrices, linear transformations, and linear equations such as
.
Linear algebra identifies the following mathematical objects:
- Scalar: A single number.
- Vector: A one-dimensional array of numbers (also known as components or scalars), where each element has an index. We can denote vectors either with a superscript arrow (
) or in bold (x), but we’ll mostly use the bold notation throughout the book. The following is an example of a vector:
![<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" display="block"><mml:mi mathvariant="bold">x</mml:mi><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>→</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mfenced open="[" close="]" separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>…</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math>](https://static.packt-cdn.com/products/9781837638505/graphics/image/34.png)
We can represent a n-dimensional vector as the coordinates of a point in an n-dimensional Euclidean space,
. Think of Euclidean space as a coordinate system – the vector starts at the center of that system, and each of the...