Computing hyperdeterminant of n-dimensional squared Tensor

Viewed 171

For the purpose of computing the generalized variance of a Tensor with shape (n, n, n, ...., n) I want to compute the hyperdeterminant of the covariance of a Tensor, obtained using tfp.stats.covariance.

Suppose you have a Tensor T (the following syntax works on Tensorflow 2.0):

import tensorflow as tf
import numpy as np

T = tf.constant(np.random.random(size=(1000, 100, 100)))

The shape of the obtained tensor is (1000, 100, 100).

To determine its covariance we use tfp.stats.covariance:

import tensorflow_probability as tfp

@tf.function() # To evaluate graph.
def covariance(T):
    return tfp.stats.covariance(T)

cov = covariance(T)

The obtained tensor cov has shape (100, 100, 100). I would love now to compute its hyperdeterminant, but the implementation present in TensorFlow tf.linalg.det is defined on vectors of shape (n, m, m) of squared matrices of shape (m, m) and therefore computes m determinants, one for each matrix.

@tf.function() # To evaluate graph.
def determinant(T):
    return tf.linalg.det(T)

det = determinant(cov)

The obtained Tensor det has shape (100,).

How do I obtain a scalar hyperdeterminant for any given hyper-cubic Tensor with shape (n, n, n, ..., n)?

Thanks!

References

Since there's little to no material on the subject of hyperdeterminant of hypercubes, I list here some of the seminal papers on the matter:

0 Answers
Related