A Simple and Efficient Tensor Calculus for Machine Learning

10/07/2020
by   Sören Laue, et al.
0

Computing derivatives of tensor expressions, also known as tensor calculus, is a fundamental task in machine learning. A key concern is the efficiency of evaluating the expressions and their derivatives that hinges on the representation of these expressions. Recently, an algorithm for computing higher order derivatives of tensor expressions like Jacobians or Hessians has been introduced that is a few orders of magnitude faster than previous state-of-the-art approaches. Unfortunately, the approach is based on Ricci notation and hence cannot be incorporated into automatic differentiation frameworks from deep learning like TensorFlow, PyTorch, autograd, or JAX that use the simpler Einstein notation. This leaves two options, to either change the underlying tensor representation in these frameworks or to develop a new, provably correct algorithm based on Einstein notation. Obviously, the first option is impractical. Hence, we pursue the second option. Here, we show that using Ricci notation is not necessary for an efficient tensor calculus and develop an equally efficient method for the simpler Einstein notation. It turns out that turning to Einstein notation enables further improvements that lead to even better efficiency. The methods that are described in this paper have been implemented in the online tool www.MatrixCalculus.org for computing derivatives of matrix and tensor expressions. An extended abstract of this paper appeared as "A Simple and Efficient Tensor Calculus", AAAI 2020.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/08/2016

Automatic Differentiation: a look through Tensor and Operational Calculus

In this paper we take a look at Automatic Differentiation through the ey...
research
11/29/2019

Chain Rules for Hessian and Higher Derivatives Made Easy by Tensor Calculus

Computing multivariate derivatives of matrix-like expressions in the com...
research
08/25/2020

Differentiating a Tensor Language

How does one compile derivatives of tensor programs, such that the resul...
research
10/25/2016

Operational calculus on programming spaces

In this paper we develop operational calculus on programming spaces that...
research
11/03/2017

Automatic Differentiation for Tensor Algebras

Kjolstad et. al. proposed a tensor algebra compiler. It takes expression...
research
07/10/2023

A closed form exact formulation of the spectral representation of a second-order symmetric tensor and of its derivatives

The spectral decomposition of a symmetric, second-order tensor is widely...
research
03/30/2011

Internal Constraints of the Trifocal Tensor

The fundamental matrix and trifocal tensor are convenient algebraic repr...

Please sign up or login with your details

Forgot password? Click here to reset