public int [ ] sampleBatchWithReplacement ( ) { // Sample the indices with replacement. int [ ] batch = new int [ batchSize ] ; for ( int i = 0 ; i < batch . length ; i ++ ) { batch [ i ] = Prng . nextInt ( numExamples ) ; } return batch ; }
Samples a batch of indices in the range [ 0 numExamples ) with replacement .