Re: array-map [was: last call]
Lassi Kortela 07 Aug 2019 18:07 UTC
> (I looked a bit at clojure.core.matrix. Seems quite powerful,
> but I found it a bit overwhelming and lacking in elegance,
> perhaps because the API is documented in alphabetical order,
> rather than by concept/category.)
I started on a TensorFlow clojure.core.matrix wrapper once but all
details are lost to memory...
> One issue with clojure.core.matrix is that it mixes in the same package
> general rank-N array procedure with more specialized rank-2 matrix
> procedures,
True. Haven't thought of this in any detail.
> The clojure.core.matrix API support using different "implementations".
> SRFI 164 supports this partly with the concept of "generalized vector"
> and "underlying vector": A Clojure "implementation" corresponds to a
> generalized vector type. You can use array-reshape on any generalized
> vector.
That's great news :) The major selling point of clojure.core.matrix is
precisely that it supports multiple underlying implementations (so that
when e.g. TensorFlow came along, it could just be plugged in after the
fact). If SRFI 164 does likewise, that sounds very promising.
I'd like to try plugging one of the major machine learning frameworks
like TensorFlow or Torch into Scheme sometime, maybe late next year,
though I won't complain if someone beats me to it :) Java is an
officially supported platform for TensorFlow so it plugging it into Kawa
would probably be approximately as easy as plugging it into Clojure.
Using this SRFI would be a natural starting point.
I think they develop the model training stuff in Python and the other
languages lag behind (even the ones with official status) but once the
models have been trained, they are quite easy to run in several kinds of
environments, including JVM.
> For things like sparse matrices the build-array procedure provides the
> necessary primitive.
Even better!