[Math] Matrix vector addition

arithmeticmatrices

Given A a 3×3 matrix and B a 3×1 matrix (or column vector), I am asked to calculate A + B. Both are initially filled with one's. To my knowledge the two matrices would have to be of the same n×m dimensionions. However, if I do the addition in Python (using Numpy matrices and the '+' operator) I get a 3×3 matrix filled with two's.

How is this matrix and column vector added? Might I be misunderstanding what Python does?

Best Answer

This is a case of less conventional notation used in deep learning: We allow the addition of a matrix and a vector, yielding another matrix: $C = A+b$, where $C_{i,j}$ is $A_{i,j} + b_j$. See: http://www.deeplearningbook.org/contents/linear_algebra.html (page 32)

Related Question