sawcordwell / pymdptoolbox

Markov Decision Process (MDP) Toolbox for Python
BSD 3-Clause "New" or "Revised" License
521 stars 251 forks source link

Sparse rewards are converted to dense arrays #10

Open sawcordwell opened 9 years ago

sawcordwell commented 9 years ago

Due to the way that scipy works, if the rewards are given in sparse format they are at the moment converted to dense arrays. Specifically sparse.multiply(dense) will result in a dense numpy.matrix and sparse.sum(1) will result in a numpy.matrix.

It may be dersirable to have a way of keeping them sparse.

venomouse commented 8 years ago

The same is true for probability matrices. For example, when checking for stochasticity of P matrices in ValueIteration class, the sparse matrices are converted to dense ones.