mikera / core.matrix

core.matrix : Multi-dimensional array programming API for Clojure
Other
699 stars 113 forks source link

Tensors #196

Open tgoossens opened 9 years ago

tgoossens commented 9 years ago

I'm have not really looked in to the library yet.

But I was wondering what it would take to extend it to N-way tensors. If I find the time I would be happy to look into that.

mschuene commented 9 years ago

Aren't tensors just N-dimensional arrays the same way like matrices are 2-Dimensional arrays? If this is all you need, than core.matrix already supports multi dimensional arrays out of the box. (implementations might only support 2-dimensional matrices, but take a look at NDArray for example)

tgoossens commented 9 years ago

Yes. This is correct. I had to be more precise.

I was thinking about extending it to tensor products, tensor-vector products, decompositions etc..

mars0i commented 9 years ago

For whatever it's worth, I don't have a current use case for tensor products, etc., but I think this seems like something that could be generally very useful.

mikera commented 9 years ago

Good idea!

I think some of this should already be complete, but it probably hasn't had enough testing / use case exploration. Some quick thoughts:

tgoossens commented 9 years ago

@mars0i
I have to use tensors (and all the corresponding algebra) for my master thesis :) . Usage of tensors in data science and engineering (my discipline) is quite new but I assure you it will become very important! ;)

mikera commented 9 years ago

@tgoossens absolutely agree!

If you are able to do some core.matrix development with real use cases that would be fantastic - always best to have a real project in mind....

tgoossens commented 9 years ago

@mikera

I will have to study tensor algebra in quite some detail for my master thesis. And one of my professors is an expert in it. His work: http://www.tensorlab.net/

If I find the time I will gladly discuss and investigate the possibilities further!

mars0i commented 9 years ago

I had heard that tensor algebra was common in some parts of physics, but I became aware of because it's been used in evolutionary developmental biology (see chapter 8 of Sean Rice's Evolutionary Theory).

mikera commented 9 years ago

@tgoossens thanks - Tensorlab looks very interesting. I'd certainly love to see some similar tensor support in core.matrix or a related library in the Clojure ecosystem!