Project DelphiTensors Workshop

What about tensors?

A fair question with an honest answer: no single tensor inverse is in common use. Several definitions exist — built on the Einstein product, or on the t-product for order-3 tensors — and they are active research.

In practice, in machine learning, you unfold the tensor into a matrix, use the matrix pseudoinverse, and fold the result back. That works because unfolding loses nothing.

T = np.random.randn(4, 3, 5) M = unfold(T, 0) # (4, 15) M_plus = np.linalg.pinv(M) # (15, 4) np.allclose(M @ M_plus @ M, M) # True

A general lesson worth remembering: when a tensor problem is hard, unfold it to a matrix, solve it there, and fold back.