Guozhen AIGlobal AI field notes and model intelligence

English translation

Simulated pixel values (0–255) for an image

Published:

Category: Linear Algebra

Read time: 4 min

Reads: 0

Lesson #3Views are counted together with the original Chinese articleImages are preserved from the source page

Concept Map: Definition and Representation of Vectors

A vector can represent either a geometric arrow or a row of features. When reading AI code, it is far more common to convert samples into feature vectors.

Vector Definition & Representation Checklist

I verify both vector length and feature order. Even if the length is correct, an incorrect ordering still results in a fundamentally wrong meaning for the model.

Understanding the concept of vectors is essential in learning linear algebra—not merely as an abstract mathematical construct, but as a critical tool for solving real-world problems. In our previous article, we discussed the importance of linear algebra and emphasized its broad applications across modern artificial intelligence and data science. This article dives deeper into what vectors are, how they are represented, and how they appear in practical applications.

Definition of a Vector

In mathematics, a vector is a quantity possessing both magnitude and direction. It can represent points in multidimensional space, velocity, force, and other physical quantities. In linear algebra, a vector is typically expressed as an ordered list of numbers—either as a row vector or a column vector.

Vector Definition & Representation Judgment Card

When learning the definition of vectors, don’t fixate solely on a sequence of numbers. First ask: What do these numbers represent? Position? Direction? Features? Weights? Clarifying this upfront makes subsequent topics—like matrices and model representations—much easier to grasp.

One-Dimensional vs. Multidimensional Vectors

Simply put, a one-dimensional vector is represented by a single number, whereas a multidimensional vector consists of multiple numbers. For example:

  • One-dimensional vector: v=[5]\mathbf{v} = [5]
  • Two-dimensional vector: v=[3,4]\mathbf{v} = [3, 4]
  • Three-dimensional vector: v=[1,2,2]\mathbf{v} = [1, -2, 2]

Mathematically, vRn\mathbf{v} \in \mathbb{R}^n denotes an nn-dimensional vector, where Rn\mathbb{R}^n represents the set of all possible nn-dimensional real-valued vectors.

Representation of Vectors

Vectors can be represented in several ways; the most common include:

Linear Algebra Application Breakdown Card

Before reading “Vectors and Matrices: Definition and Representation of Vectors”, first align the problem, keywords, operations, and acceptance criteria shown in the diagram. Then proceed to the main text—it’ll save effort. After reading, try re-explaining the content using your own project.

  1. Coordinate Representation: In geometry, a vector is located using coordinates. For instance, a two-dimensional vector v=[x,y]\mathbf{v} = [x, y] has components xx and yy, representing its projections onto the xx- and yy-axes, respectively.

  2. Column Vectors and Row Vectors:

    • A column vector is defined as an n×1n \times 1 matrix, e.g.: v=[x1x2xn]\mathbf{v} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}
    • A row vector is defined as a 1×n1 \times n matrix, e.g.: v=[x1x2xn]\mathbf{v} = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix}

Such definitions make vectors highly compatible with matrix operations. Multiplying a row vector by a column vector yields a scalar—the dot product.

Vector Operations

Basic operations between vectors include addition and scalar multiplication.

  • Vector Addition:
    Given two vectors a=[a1,a2]\mathbf{a} = [a_1, a_2] and b=[b1,b2]\mathbf{b} = [b_1, b_2], their sum is:

    c=a+b=[a1+b1,  a2+b2]\mathbf{c} = \mathbf{a} + \mathbf{b} = [a_1 + b_1,\; a_2 + b_2]
  • Scalar Multiplication:
    Multiplying a scalar kk by a vector a=[a1,a2]\mathbf{a} = [a_1, a_2] yields:

    b=ka=[ka1,  ka2]\mathbf{b} = k \cdot \mathbf{a} = [k \cdot a_1,\; k \cdot a_2]

Example: Vectors in Machine Learning

In machine learning, feature vectors encode individual data points. For instance, in classification tasks, an image’s pixel values can be represented as a vector.

Suppose we have a grayscale image of size 28×2828 \times 28. Its pixels can be flattened into a one-dimensional vector. Below is a simplified version using only six pixels:

import numpy as np

# Simulated pixel values (0–255) for an image
image_pixels = np.array([255, 0, 255, 128, 64, 32]).reshape(6, 1)  # Column vector
print(image_pixels)

This code produces a column vector representing the image’s pixel intensities. During model training, machine learning algorithms perform computations over such vectors to extract meaningful features.

Application Retrospective Card: Vectors and Matrices — Definition and Representation of Vectors

If you haven’t fully internalized “Vectors and Matrices: Definition and Representation of Vectors”, revisit the four actions outlined on this card.

Application Verification Card: Vectors and Matrices — Definition and Representation of Vectors

When reviewing “Vectors and Matrices: Definition and Representation of Vectors”, you need not build a full-scale project right away. Start with a simple, concrete example to confirm whether the core ideas are clear.

Summary

Vectors are a foundational concept in linear algebra, widely applied across machine learning, computer science, and many other domains. By mastering their definition and representation, we lay the groundwork for the next topic: matrices—their definition, structure, and applications. The following article will explore matrices in depth, further illuminating the architecture and utility of linear algebra.

Continue

Keep reading from here

Browse English site

Reader Messages

Reader messages

Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

Max 800 characters

To reduce spam, each message is checked for length, link count, and posting frequency.

0/800

Messages

0 messages
Loading messages...