I am seeking a vectorized form of the following computation:
import numpy as np
D = 100
N = 1000
K = 10
X = np.random.uniform(0, 1, (K, N))
T = np.random.uniform(0, 1000, (D, N))
out = np.zeros((D, K))
for i in range(D):
for j in range(K):
out[i, j] = np.prod(X[j, :] ** T[i, :])
There are einsum-style things I've tried, but the presence of the np.prod is throwing me off a bit.
EDIT: Reduced size of matrices.