Array Algebra #
Records and tuples #
Records as labeled data combinations #
Using records to represent colors #
Grayscale from color #
Tinting as multiplication #
Tuples as unlabeled data combinations #
Parts of records and tuples #
Forgetting and remembering: converting between records into tuples #
Terminology: tuples = lists = vectors #
Images to matrices #
Grayscale images as matrices #
How to represent color images #
-
records of matrices
-
matrices of records
Color to grayscale transformation #
Flipping and translating images #
Downscaling images #
Matrices as tuples of tuples #
Arrays #
How do we generalize the sequence datum, tuple, matrix, ... ? #
Cells: base items in an array #
Axes: sides of arrays #
N-arrays #
Named vs numbered axes #
Array shapes #
Array algebra vs linear algebra #
Sparse arrays #
- Row sparse vs column sparse
Array operations #
Combining arrays #
-
Slicing: taking parts of arrays
-
Broadcasting: making constant axes
-
Transposing: switching order of axes
-
Mapping: transforming cells
-
Threading: combining two arrays
-
Projection: summing over dimensions
-
Aggregation: X'ing over dimenions
Convolution #
Thinking about arrays as shapes #
Combining arrays as combining shapes #
- Matrix multiplication in 3D
Thinking about arrays as functions #
-
Slicing as pre-filling arguments
-
Broadcasting as constant arguments
-
Projection as removing arguments
Combining arrays by combining functions #
Applications #
Numpy and Jax #
-
how they combine arrays
-
einsum
-
Dex and the future of DL frameworks
Common kinds of axes #
-
spatial
-
temporal
-
batch
-
class
-
feature
Examples #
-
grayscaling batches of images
-
linear regression
-
classification
-
image convolution
-
attention
Advanced topics #
-
Hadamard product
-
Gram matrix
-
Vector spaces and linear maps
-
Vectors and tuples: choosing a basis