bootcamp_machine-learning icon indicating copy to clipboard operation
bootcamp_machine-learning copied to clipboard

ML00 ex00: return type of Matrix * Vector

Open mli42 opened this issue 2 years ago • 0 comments

  • Day: 00
  • Exercise: 00

There is a commentary for the __mul__ method that says returns a Vector if we perform Matrix * Vector multiplication

IMG_20220810_120113

But in the examples, there is the choice between Matrix and Vector:

m1 * v1
# Output:
Matrix([[8], [16]])
# Or: Vector([[8], [16]

(Also the last line has ]) missing)

But there is an exception, if we multiply a Matrix of shape (3, 1) with a Vector of shape (1, 2), we should obtain a Matrix of shape (3, 2) and not a Vector. We might want a row vector or a colomn vector when possible, but definitly not every time.

Fixed on:

  • [ ] Github
  • [ ] Gitlab

mli42 avatar Aug 10 '22 16:08 mli42