bootcamp_machine-learning
bootcamp_machine-learning copied to clipboard
ML00 ex00: return type of Matrix * Vector
- Day: 00
- Exercise: 00
There is a commentary for the __mul__
method that says returns a Vector if we perform Matrix * Vector multiplication
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