![]() The linear algebra interpretation is really the more bizarre one. If you’re NOT working in the context of Linear Algebra or Machine Learning, then interpreting “a * b” as an element-wise multiplication seems perflectly reasonable to me. So an array is a computer science concept, and not a linear algebra one. If you’re teaching a software engineer the basics of machine learning, a good way to explain what a vector is, is that’s it’s “just an array of floating point values”. ![]() “Array” is a computer science term–in Python we call these “lists”, but in more formal languages like C or Java we have “arrays”. I think there’s a good reason that numpy.ndarray uses the term “array”. Issue #1: ndarray operations are element-wise In the rest of the post we’ll do just that. Using numpy.matrix will probably just get us into trouble in the long run, so I think we’re better off adjusting our thinking instead to using ndarray. However, don’t actually do this! The community (and libraries) don’t use numpy.matrix in practice (they even plan to deprecate it!). Using * does perform matrix multiplication, and the matrix type is always two dimensional, whether it’s storing a matrix or a vector, just like in Matlab. The matrix class is designed to behave like matrix variables in Matlab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |