Replies: 15 comments 32 replies
-
In the meantime, I will write an extension method to achieve my goal Temporary extension method that I am using:
|
Beta Was this translation helpful? Give feedback.
-
Yes, that can be a useful extension. Right now I will change the title of this topic a bit. Anyone interested in implementing this feature? |
Beta Was this translation helpful? Give feedback.
-
Once I finish the |
Beta Was this translation helpful? Give feedback.
-
👍 thanks for the offer. and for keeping focus :) |
Beta Was this translation helpful? Give feedback.
-
We can consider two cases in this regard, as noted by @alvinhui in #1228:
|
Beta Was this translation helpful? Give feedback.
-
This could definitely be useful in some cases. But I suggest that there should be a way to turn it off. Example: I mainly use MathJS for math webapps to be used by high-school and undergraduate students. I generally want students to think that adding matrix + vector is not valid. Great, MathJS throws a useful error! I could be one of a small minority, but I would guess that MathJS's current behavior is useful to other people. (Admittedly, if people like me want this error, it's not too hard to do our own validation. But that makes upgrading harder.) Incidentally, Edit: To be clear, doing my own validation really is not a big deal. Just something to consider :) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the inputs guys =) |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing your thoughts @ChristopherChudzicki. Very good point to weight convenience against more explicit notations preventing you from accidental mistakes. We could also think about a solution where we have separate, explicit functions (like Just thinking aloud here :) |
Beta Was this translation helpful? Give feedback.
-
That said, it occurs to me that allowing So maybe this is the "right" behavior. |
Beta Was this translation helpful? Give feedback.
-
Yes that's true. I'm just exploring different options, not sure yet what solution would best serve the audience of mathjs. |
Beta Was this translation helpful? Give feedback.
-
Any progress on this? Am getting into mathjs as a numpy replacement in the browser for implementing ML/AI stuffs. Broadcasting is a verrry handy feature that makes a lot of learning algorithms a bit simpler to implement. Happy to pitch in. |
Beta Was this translation helpful? Give feedback.
-
Also might add the word "Broadcasting" to the title for the numpy folks looking for help on this. I'd imagine they'll become a larger and larger part of your target audience, if they aren't currently. |
Beta Was this translation helpful? Give feedback.
-
@chivington thanks for your input. There is no progress on this feature so far. I've marked the issue with a label "help wanted", now. Anyone interested in implementing this feature? |
Beta Was this translation helpful? Give feedback.
-
Hello!! My case is similar to @chivington. I am getting into machine learning on the web and I need an alternative for NumPy. The above feature (broadcasting) is a real help for easier manipulation of matrices. Is there any way I can implement it alone in the meantime until it is a mainstream MathJS function (if it will ever be). 😃 |
Beta Was this translation helpful? Give feedback.
-
The solution would be to implement your own version of all operators/functions like subtract, add, etc, like Jason suggests in #1165 (comment). |
Beta Was this translation helpful? Give feedback.
-
I am getting a dimension error while using math.subtract()
Running the code raises the below error
I believe
math.subtract(X, M)
should returnsame goes for
math.sum
math.multiply
Beta Was this translation helpful? Give feedback.
All reactions