liveBook · Manning

Coordinate system

As explained in Math and Architectures of Deep Learning

A coordinate system with perpendicular axes used here as the original input-space representation before latent transformation.

A coordinate system assigns an origin and axes to represent positions numerically. In two dimensions, an array such as (x, y) identifies a point relative to those chosen axes; the underlying vector remains independent of that choice. section 2.1.1

For machine learning, this choice turns inputs and outputs into points in a space where models can be viewed as geometric transformations. Rotating the axes changes the representation without changing the underlying geometric object. section 2.1.1 section 2.17

A coordinate system supports several related operations:

  • Represent points with coordinate arrays in two or more dimensions. section 2.1.1
  • Rotate axes so a quadratic form becomes diagonal and aligned with an ellipse’s axes. section 2.17
  • Interpret eigenvectors of a symmetric matrix as the axes of the represented hyperellipse. section 2.17

Page coordinates and a rotated ellipse

Using the bottom-left corner of a page as the origin and its edges as axes gives the top-right corner coordinates based on the page width and height. For 5x² + 6xy + 5y² = 20, rotating the coordinate system by 45° aligns the axes with the ellipse. section 2.1.1 section 2.17.1

Listing 2.21 Axes of a hyperellipse
ellipse_eq = sy.Eq(5*x**2 + 5*y**2 +
                      6*x*y, 20)                   ①

A = torch.tensor([[5, 3], [3, 5]]).float()

l, S = torch.linalg.eig(A)

x_axis_vec = torch.zeros((A.shape[0]))             ②

first_eigen_vec = S[:, 0]                          ③

dot_prod = torch.dot(x_axis_vec, first_eigen_vec)  ④

theta = math.acos(dot_prod)
theta = math.degrees(theta)                        ⑤

① Equation of the ellipse: 5x2 + 6xy + 5y2 = 20 or TA = 20, where

② X-axis vector

③ Major axis of the ellipse

④ The dot product between two vectors is the cosine of the angle between them.

⑤ The angle between the ellipse’s major axis and the X-axis: 45° (see figure 2.16)

Inspect the PyTorch listing that computes an ellipse’s principal direction and its angle from the x-axis. section 2.17.1

How Math and Architectures of Deep Learning covers it

How deep it goes
Defines coordinate dependence, then develops rotations, diagonalization, and eigenvector-aligned axes for hyperellipses.
Examples
Uses page coordinates, a two-dimensional hyperellipse, eigenvector angles, and PyTorch code as concrete illustrations.
What it assumes
Builds from vectors and matrices, while grounding coordinate representation in elementary Cartesian geometry.
What you can do after
Apply it via PyTorch to represent points and rotate coordinates until a symmetric ellipse matrix becomes diagonal.
How it connects
Connects coordinate systems with vectors, matrices, tensors, eigenvectors, diagonalization, and geometric transformations.

Also explained in

Compare how 4 books explain coordinate system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.