I'm implementing a neural network in python, as a part of backpropagation I need to multiply a 3D matrix,call it A, dimension (200, 100, 1) , by a 2D matrix, call it W,dimension (100, 200) the result should have dimensions (200, 200, 1).
A is an error vector, W is a weight matrix, the product is to be used to calculate the updates for the previous layer.
I tried solving it using matrix_multiply(from numpy.core.umath_tests), I tried reshaping W to (100,200,1) and then multiplying, but that throws
ValueError: matrix_multiply: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (m,n),(n,p)->(m,p) (size 100 is different from 1).
How can I solve this?
Aas (200, 100, 1), instead of dropping the trivial dimension and making its shape (200, 100)?