0

I got a 3D array with W = shape(D,C,F) and a 2D array with X = shape(D,F). And I want to output a matrix with shape (D,C).

Currently, what I do is to iterate the rows in X and W

for row in X.shape[0]:
    X[row].dot(W[row].T)

Is there any way that I do not need to do the iteration? Can I do it just like X.dot(W.T)? Thanks.

Mozzie
  • 353
  • 2
  • 12

1 Answers1

0

Try indexing W.T in the statement you have. It is difficult for me to see without a little more detail, but something like X.dot(W.T[:1]) seems like it might work in your case.

Sam Holloway
  • 121
  • 3