Does Neanderthal support higher-dimensional arrays? For example, can I create this 2 × 3 × 4 array using Neanderthal?
[[[1 2 3 4]
[2 3 4 5]
[3 4 5 6]]
[[1 3 5 7]
[2 4 6 8]
[3 5 7 9]]]
I only need this for storage and convenience, since I want every entry to be indexable by three numbers, i, j and k. I don’t need tensor math, though—my plan is to slice regular matrices out of it (e.g., all entries with k = 2) and then do the math, so regular matrix multiplication is good enough for me.Have you tried this:
https://cnuernber.github.io/dtype-next/tech.v3.tensor.html
This has funtiocn mget to (mget tens x y z & args)
and select / slicing which looks like slicing
Neanderthal claims to be very fast, specially because it supports GPU, what dtype-next does not. It runs as well on 'native' BLAS, which should be faster then JVM for some cases. Dtype-next is CPU and pure JVM, which has pros and cons
Thank you. It seems that deep-diamond doesn’t have any functions for indexing or slicing 3D tensors (e.g., to get a specific entry or a 2D matrix), so it might not suit my use case.
Thank you. I’ve actually tried both dtype-next and core.matrix, and am using the latter. I was hoping to speed up my matrix math and thought neanderthal would be a good way to do it, but if I have to convert between neanderthal matrices and dtype-next tensors then that might negate any performance benefit.
Not neanderthal as such.
There is deep-diamond which supports tensors of any dimension:
https://github.com/uncomplicate/deep-diamond
So for math, you would indeed need to "slide" off and go back to naenderthal. Documentation is mainly as tests (or in the book): https://github.com/uncomplicate/deep-diamond/blob/master/test/uncomplicate/diamond/tensor_test.clj