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.
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.
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 densenumpy.matrix
andsparse.sum(1)
will result in anumpy.matrix
.It may be dersirable to have a way of keeping them sparse.