added a way to cycle through minibatches of a matrix with iter_minibatches a finite amount of times