taggit Summary

The operation should look very familiar, given the spoiler alert in the subtitle and the fact that I told you dot products were going to be important a few paragraphs ago––given two matrices A and B, the entry in the i-th row and the j-th column is just the dot product of the i-th row of A with the j-th column of B!First, we need to make sure that the objects we want to dot will be compatible––we do this by checking to see if the number of columns in (i.e. the length of the row vectors) is equal to the number of rows in (i.e. the length of the column vectors). If they are compatible, meaning the row vectors from can be dotted with the column vectors from , then we create , a 2D array with the correct dimensions (the number of row vectors we’ll be using from by the number of column vectors we’ll be using from ). We use a nested loop structure to iterate over the rows of and the columns of , and the entry in the -th row and -th column of is simply the dot product of the -th row of matrix and the -th col of matrix .