Compose NYC 2019
Speaker: Allister Beharry
Linear systems are essential to scientific modelling and computing and vector spaces are one of the core abstractions in modern machine learning. Matrices are computational devices for calculating linear transformations from one vector space to the next and matrix algebra and calculus represent the kinds of operations that can be performed on linear systems.
Type systems for linear algebra in existing scientific and ML software libraries across all major languages usually provide a single base multi-dimensional array type that represents a vector or matrix or tensor of any shape and dimensions (e.g. a NumPy array or Torch tensor.) Range checks on array types occur at run-time as do checks determining if for instance two arrays are conformable for matrix multiplication. This means that invalid matrix algebra or calculus operations can only be detected at run-time.
Since the rank and dimensions of a vector, matrix or higher-order tensor are elements of the natural numbers + zero, a matrix or tensor type which depends on the number and size of each dimension could be used to lift many of these checks to the type level and move detection of linear algebra errors from run-time to compile-time.
4 окт 2024