liveBook · Manning

Hyperellipse

As explained in Math and Architectures of Deep Learning

A generalization of an ellipse to higher dimensions.

A hyperellipse generalizes an ellipse to multiple dimensions. In two dimensions, the equation 5x² + 6xy + 5y² = 20 can be written with a symmetric matrix, linking geometric shape to linear algebra and machine-learning computation. section 2.17.1 section 2.0

Find the axes by rotating into the eigenvector coordinate system:

  • Represent the ellipse with a symmetric matrix A. section 2.17.1
  • Diagonalize A as SΣS⁻¹; orthogonal eigenvectors make S⁻¹ = Sᵀ. section 2.17.1
  • Interpret S as a rotation that aligns the coordinate axes with the hyperellipse axes. section 2.17.1

A 45-degree major axis

For A = [[5, 3], [3, 5]], PyTorch computes the eigenvectors. The dot product with the x-axis gives the angle of the major axis: 45°. section 2.17.1

Figure 2.16 Note that the ellipse’s major axis forms an angle of 45 degrees with the X-axis. Rotating the coordinate system by this angle will align the ellipse axes with the coordinate axes. Subsequently, the first principal vector will also lie along this direction.

Use the geometric figure to see how rotation places the principal direction along the ellipse’s major axis. section 2.17.1

How Math and Architectures of Deep Learning covers it

How deep it goes
Derives axis alignment through diagonalization and orthogonal eigenvectors, using a visualizable two-dimensional example with extensible code.
Examples
Uses 5x² + 6xy + 5y² = 20, a PyTorch matrix, eigenvectors, a dot product, and a 45-degree diagram.
What it assumes
Builds from vectors and matrices before using eigenvalues, eigenvectors, and coordinate transformations.
What you can do after
Apply it via PyTorch to compute eigenvectors and determine hyperellipse axis directions.
How it connects
Ties hyperellipses to vectors, matrices, eigenvalues, eigenvectors, and coordinate rotation.

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.