n = 3; m = 5; k = 10;
A = ones(n,m);
B = randn(m,k);
B(:,:,i) = randn(m,k);
result = A(1,:)*B(:,:,1);
concatenayte = A(i,:)*B(:,:,i);
result = [result ; concatenayte];
What I want to do is multiply each row of A of size (n x m), with different matrices, namely n-number of B's each of size (m x k).
I have done my best in making clear what I want to achieve explicitly.
How can I do the multiplication efficiently i.e. without for-loop? Is it even possible with what is offered by MatLab?
Do I perhaps need Parallel Computing Toolbox (which I don't have at the moment) or anything?
% For more context, I am trying to code backpropagtion of a flat fully connected layer with batch normalization(before activation).