Skip to content
This repository has been archived by the owner on Feb 24, 2019. It is now read-only.

Refactor for performance #1

Open
rreusser opened this issue Aug 16, 2015 · 3 comments
Open

Refactor for performance #1

rreusser opened this issue Aug 16, 2015 · 3 comments

Comments

@rreusser
Copy link
Owner

The approach is technically valid but highly questionable. I think this should really have started as a fork of cwise that generates the minimal amount of code to accomplish map-reduce operations. I don't know whether it'd be best to map-reduce one slice at a time or whether it's best to map-reduce over the initial array in whichever order cwise prefers.

@mikolalysenko, @jaspervdg, would be interested to hear if you have a better idea for this. Seemed like ndarray basically just needs a coherent way to talk about reductions over dimensions. But didn't seem like such a good idea that I stuck it in scijs/ right away…

@rreusser
Copy link
Owner Author

I'm starting to think it'd be way better to just iterate over the dimensions directly and implement this as as a cwise operation on each slice. This module wouldn't have to do any reduction work and you'd actually gain a lot of features from using cwise directly. Actually, wait, why did I implement things as they are in the first place? Sigh.

@mikolalysenko
Copy link

You can already do a reduce operation in cwise, take a look at the sum examples. Global variables can be stored in the this.x properties and reused.

@mikolalysenko
Copy link

Still, I think there are always other ways to do things. It would be nice to try out some different ideas. One thing I've long wanted is a way to express things like general tensor operations, for example matrix multiplication or tensor contraction on ndarrays.

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

No branches or pull requests

2 participants