Home / Maths for AI / Symbols / Vectors and matrices

Matrix entry

Say it: "A i j", "the i, j entry of A"

What it means

A matrix is a grid of numbers. AijA_{ij} is the entry in row ii, column jj. An m×nm \times n matrix has mm rows and nn columns.

Example

A=(123456),A23=6A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}, \quad A_{23} = 6

Row 2, column 3.

In code

import numpy as np
A = np.array([[1, 2, 3], [4, 5, 6]])
print(A[1, 2], A.shape)   # Python counts from 0

Output

6 (2, 3)

Where it appears in machine learning

A dataset is a matrix (rows = examples, columns = features), and so are the weights of a layer.

Related symbols

Learn it properly in the free lesson Matrices, with practice questions that check your answers.