One idea that I had was to reshape B to be Q x M where Q=NxP. Since I want to do this on a GPU, this obviously calls for converting my problem into matrix multiplication (this is true if I dont use a GPU as well for that matter).īut I do not exactly know how to convert it to that. , b), np.dot(a, b), np.dot(a, b)]]ĭoing this manually gives: , This is how I want my output to be:, b), np.dot(a, b), np.dot(a, b)], I am using numpy and Python and would be performing this operation on a GPU.įor a tiny example, let N= 4, M= 5, P= 3. For each vector a from A, it has to be multiplied with each pi from B of the same row, to get an output of dimensions N x P. I have a A = N x M matrix and another array B = N x P x M where P is typically 9 or 15.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |