Matlab sparse tensor

假如想象 提交于 2019-12-01 17:26:04

问题


Does Matlab support efficient operations on large sparse tensors?

More specifically:

  1. Is there an elegant way, similar to sparse, of loading and storing a sparse tensor? As far as I can understand, sparse can only load matrices.
  2. Are operations like tensor product implemented efficiently over sparse tensors?

I realize I can always store a tensor as a combination of cell arrays of matrices, but that would require using loops, and I'm hoping to avoid that.

Since the data I'm working with is very large, I cannot consider a non-sparse representation.


回答1:


Out of the box, I believe MATLAB only handles sparse matrices, as you say.

But you might like to take a look at the Tensor Toolbox and the N-way Toolbox to see if they meet your needs. Both are freely available, and I've heard good things about both (although I've used neither myself). The Tensor Toolbox in particular seems to have at least some support for sparse multidimensional arrays.




回答2:


You can use the Tensor Toolbox for working with tensors. you can use the sptensor() to create the sparse tensor in this Toolbox.




回答3:


If you're looking for a truly scalable solution, take a look at SPLATT: http://glaros.dtc.umn.edu/gkhome/splatt/overview



来源:https://stackoverflow.com/questions/8229154/matlab-sparse-tensor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!