I have some matrices of decent size (2000*2000) and I wish to have symbolic expressions in the elements of the matrices - i.e. .9**b + .8**b + .7**b ...
is an example of an element. The matrices are quite sparse.
I am creating these matrices by adding up intermediate calculations. I would like to store them to disk to be read in later and evaluated with different values of b
.
I have played around with sympy and it does exactly what I need it to do however it is mind-numbingly slow to do simple additions. From what I have read it seems theano or tensorflow might be able to do this with Tensors but I could not figure out how to put a symbol in a Tensor.
Can anyone point me in the right direction as to the best tool to use for this task? I'd prefer it to be in python but if something outside python would do the job that'd be nice too.
A_sy = sy.SparseMatrix(900,900,0)
b = sy.abc.b
A_sy += arr**b
.arr
in this case is a 900 by 900 numpy array. I have tried converting arr to a sparse format before doing the addition but it doesn't help. It is suprisingly slow - like a minute or two to do that addition. I would need to do thousands of such additions so it's too slow as is. – Pippas