I've been trying to vectorize out the loops of the following code. (edited for comments)
M, N, F = 10, 50, 30
ts = np.linspace(0.001,3,M)
v = np.random.rand(N,1)
A = np.random.rand(N,N)
D = np.zeros(shape=(N,N,M))
for i, t in enumerate(ts):
for x in range(0,N):
for y in range(x,N):
D[x,y,i] = np.sum( np.exp(-t * v[0:F]) * A[x,0:F] * A[y,0:F] )
D[y,x,i] = D[x,y,i]
I've been reading other questions but can't figure out how to apply it here.
Suggestions?
ts,v, andA, andF. - wwiinfandF? - Khris