Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcasting support for nmatrix #589

Open
v0dro opened this issue Mar 31, 2017 · 2 comments
Open

Broadcasting support for nmatrix #589

v0dro opened this issue Mar 31, 2017 · 2 comments

Comments

@v0dro
Copy link
Member

v0dro commented Mar 31, 2017

Performing arithmetic operations by broadcasting elements in C level instead of looping over them in Ruby would be a nice way to speed up things in nmatrix. Take for example the numpy way of doing this.

Numo::NArray also supports broadcasting.

@translunar
Copy link
Member

translunar commented Mar 31, 2017

I tend to feel like broadcasting creates confusing bugs in code. For example, if I add x and x-transpose together with Numpy, I expect an error — but actually I get an nxn matrix.

Maybe there's a way to have it be a feature that is turned on and off according to user preference?

@v0dro
Copy link
Member Author

v0dro commented Apr 1, 2017

Yes maybe we can have it with support to turn it off and on. I think most of the problems with nmatrix speed involving things like multiplication and math operations can be overcome if we use broadcasting.

Having a switch would be helpful. If this is done, nmatrix can be internally used in daru for a massive increase in efficiency. I'm a bit skeptical about using Numo::NArray in daru because that will mean dropping support for JRuby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants