liveBook · Manning

Vector

As explained in Deep Learning with R, Third Edition

A vector is a quantity represented by an ordered collection of components and interpreted geometrically as a directed displacement or point relative to an origin.

A vector is an ordered collection of numbers arranged along one axis. Geometrically, it represents a point or a directed arrow from the origin. In neural networks, inputs, targets, and intermediate representations are commonly treated as vectors in geometric spaces. section 2.2.2 section 20.1.3

A five-entry vector

x <- as.array(c(12, 3, 6, 14, 7)) str(x) # num [1:5(1d)] 12 3 6 14 7 dim(x) # [1] 5 This is a five-dimensional vector because it has five entries on one axis. It is not a five-dimensional tensor: that phrase refers to five axes, whereas this vector has rank 1. section 2.2.2

Vector addition has a geometric interpretation. Adding B to A moves the point represented by A by B’s distance and direction; applying the same addition to many points translates the entire object without distorting it. Matrix products similarly express rotation, scaling, and other linear transformations. section 2.3.5

Keep these tensor distinctions clear:

  • A vector, rank-1 tensor, or 1D tensor has exactly one axis. section 2.2.2
  • A vector’s dimensionality can mean the number of entries along its single axis; tensor rank means the number of axes. section 2.2.2
  • A scalar has no axes, while an R length-one numeric vector is conceptually similar to a scalar. section 2.2.1
  • Dense layers combine matrix multiplication, vector addition, and ReLU to transform tensor representations. section 2.3
x <- as.array(c(12, 3, 6, 14, 7))
str(x)

num [1:5(1d)] 12 3 6 14 7

dim(x)

[1] 5

Inspect the R vector’s contents and dimensions directly. section 2.2.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains rank, dimensionality, representations, geometric addition, and transformations, but stops short of formal derivations.
Examples
Uses an R five-entry array, vector addition for translation, and matrix products for rotation, scaling, and linear transformation.
What it assumes
Introduces vectors alongside scalars and tensors without requiring formal mathematical notation.
What you can do after
Evaluate vector representations, distinguish rank from dimensionality, and interpret basic tensor operations geometrically.
How it connects
Connects vectors to tensors, scalars, matrix multiplication, dense layers, geometric transformations, and gradient-based deep learning.

Also explained in

Compare how 11 books explain vector →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.