What is a Scalar?
A scalar is a fundamental concept in linear algebra, representing a single numerical value, often used to scale vectors and matrices. Scalars have magnitude but no direction, making them different from vectors, which have both magnitude and direction.
Example:
Imagine you have a vector v in a two-dimensional space: v = [3, 4]
Now, let’s say you want to scale this vector by a scalar value of 2. To do this, you simply multiply each component of the vector by the scalar:
2 * v = 2 * [3, 4] = [6, 8]
In this example, the scalar value 2 multiplied by the vector v resulted in a new vector [6, 8], which is twice the length of the original vector but in the same direction. Scalars are crucial in various mathematical operations and transformations in deep learning and linear algebra.