Hello,
I want to multiply a weight matrix of size (O, I) with a batch of matrices of size (I, W, B) expecting to have an output of size (O, W, B), where B is my batch size. Let us say my weight matrix is W of type KnetArray{Float32} with size (256,34). Also, my input Z is a KnetArray{Float32, 3} with size (34, 784, 64) so that the batch size is 64. I can multiply W with Z[:,:,1] with standard matrix multiplication. However, I want to multiply W with Z[:,:,j] for all j in a broadcasted manner, and obtain a tensor of size (256, 784, 64). I can use the repeat(.) function to repeat my weight matrix W so that I can use the bmm(.) function of Knet. However, the repeat function does not accept KnetArray and I want a more optimized solution. How can I perform this operation in an optimized way? I will appreciate any help.
Best,
Barışcan
--
Barışcan Bozkurt
Koç University, Electrical and Electronics Engineering & Mathematics (D.M.)