Page 128 - Touhpad Ai
P. 128
u Vectorised operations for speed: Vector and matrix operations (done using libraries like NumPy or TensorFlow)
allow for fast, parallel computations. It speeds up training and inference, especially in large-scale data or deep
learning models.
u Word embeddings in NLP: Words are converted into dense vector representations (like Word2Vec or GloVe) that
capture their meanings and relationships. This enables machines to understand context and semantics in language
tasks like translation or sentiment analysis.
u Dimensionality reduction: Techniques like PCA (Principal Component Analysis) use vectors to reduce data
dimensions while retaining important features. This improves computational efficiency and visualization while
reducing noise.
Vector Addition
Given a 3 i 2 j 7 k andb 2 i 4 j 6 k
+
ab = adding the components of the three areas separately
= (3 + 2)i + (2 – 4)j + (–7 + 6)k
+
ab = 5i – 2j – k
Vector Subtraction
Vector subtraction can be described as the addition of a vector with the negative of another vector. For example:
a = (3, 2) b = (2, 1)
a – b = a + (–b)
–b = –(2, 1) = –2, –1
a – b = (3, 2) + (–2, –1)
= (3 – 2) , (2 – 1) = (1, 1) = Unit Vector
Vector Multiplication
Before understanding vector multiplication, we need to understand that there are 2 different kinds of physical quantities:
u Scalar: Scalar quantities are those physical quantities which contains only magnitude but no direction.
u Vector: These quantities have both magnitude as well as direction.
Vector multiplication is of two types: Dot product and cross product.
Vector Dot Product
Denoted by a,b, consider:
a = (1, 2, 3) b = (–4, 5, –1)
Multiply the respective components
a.b = 1(–4) + 2(5) + 3(–1)
= –4 + 10 – 3 = 3 (Dot Product is a Scalar Value.)
Vector Cross Product
Denoted by a x b, consider:
a = (3, –3, 1) b = (–1, –4, 2) = (–3 × 2 –(–4 × 1) i –(3 × 2 –
Representing
i j k −31 3 1 3 −3 (–1 × 1)j + (3 × –4) – (–3 × –1)k
a b= 3 − 3 1 the three axes in i −42 j − −12 + k −1 −4 = (–6 + 4)i – (6 + 1) j + (–12 –3)k
×
− 1 − 42 determinant form. = –2i – 7j – 15k
The cross product results in a vector.
126 Touchpad Artificial Intelligence - XI

