aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 2. Mathematical Foundations
Lesson 1 of 13 8 min · 169 words

Scalars, vectors, matrices, tensors

Objects of 0, 1, 2 and more dimensions, and how data is stored in them.

A scalar is a single number, — a temperature or a learning rate. A vector is an ordered list of numbers, — one example's features. A matrix is a 2-D grid, — a whole dataset, or the weights of one neural-network layer.

A tensor generalises this to any number of dimensions (axes). A colour image is a 3-D tensor (height × width × 3 channels); a batch of 32 images is 4-D (32 × height × width × 3). Deep-learning libraries are built around tensors.

Notation used in this course: bold lowercase for vectors (column vectors by default), uppercase for matrices, for the -th entry and for row , column . The transpose swaps rows and columns.

Formula to remember

Inner product

Element-wise products summed; relates to the angle between vectors.

Quick check · +5 XP

What is the Manhattan distance between A(3, 5) and B(6, 9)?

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser