Added random state information to sparsify and minibatch generation