Hello,
Is it possible to slice a matrix (tensor) like in Numpy with Math.js? To give you examples,
train_image.shape # MNIST image data saved as a Tensor with shape (60000, 28, 28)
train_image[10: 100] # 1. Retrieve 10th ~ 99th MNIST digits
train_images[128 * n:128 * (n + 1)] # 2. getting an nth batch
What's the best way to achieve this?
1) Can you do this using math.subset?
2) Should we create another function named slice?
3) Is it better to do this outside of Math.js?
Yes something like that would be cool. We had a similar discussion long time ago, see #54
For reference: mathjs supports ranges like A[10: 100] and A[2: end - 2] right now, but does not offer more complicated slicing like you suggest.
See examples in the docs: http://mathjs.org/docs/expressions/syntax.html#matrices
Most helpful comment
Yes something like that would be cool. We had a similar discussion long time ago, see #54