Matrix Multiplications

Four possible perspectives(ways) to produce matrix multiplications(which give the same result):

  1. Ordered Collection of Dot Products (result matrix is built elementwise):
    Left matrix is rows, right matrix is columns.
    Each element is the dot product of a corresponding row from the left matrix and the column from the right matrix.
    So, dot product the first left row with the first right column and write the products down as columns in the result matrix, then continue to sequential rows and dot product them again with the first column.
    When all rows have been calculated return to the first row and start again with the sequential columns… till you reach the last column.
  2. Combine outer products(result matrix is built layerwise):
    Left matrix is columns, right matrix is rows.Each layer is the same size as the product matrix but has a rank 1. The layers are computed and sumed a series of rank 1 matrices.Takes the first column on the left matrix and outer products’ it with the first row on the right matrix, then write their result as a new layer/subset/outer matrix and then goes to the next column and next row and does the same.
    At the end of the calculations it adds the layered/subset/outer matrixes and gets the combined matrix result.
  3. Column Perspective (result matrix is built columnwise):
    Left matrix is columns, right matrix is columns.
    Takes the first column from the left matrix(regressor) and multiplies(weighs) it by the first element of the first column of right matrix(weight,scalar, coefficient, importance quantity), and writes the result on the new matrix, then multiplies the next column on the left column element and to the next element of the first column of right matrix and so on.. when done, sums them.
    Next it does the same with the sequential columns of the right matrix.
  4. Row perspective (result matrix is built rowwise):
    Left matrix is rows, right matrix is rows.
    Takes the first row from the right matrix and multiplies(weighs) it by the first element of the first row in the left matrix(the weights), and writes the results on the new matrix, then goes to the sequential rows on the right matrix and the sequential elements of the first row of the left marix, when done, sums them.
    Next, we do the same except we take the sequential rows on the left matrix.

 

Comments are closed, but trackbacks and pingbacks are open.