Skip to content

Commit f981c07

Browse files
Change shuffle to do sampling without replacement
1 parent ee76617 commit f981c07

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

6.3-advanced-usage-of-recurrent-neural-networks.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@
285285
" i = min_index + lookback\n",
286286
" while 1:\n",
287287
" if shuffle:\n",
288-
" rows = np.random.randint(\n",
289-
" min_index + lookback, max_index, size=batch_size)\n",
288+
" rows = np.random.choice(range(min_index + lookback, max_index), size=batch_size, replace=False)\n",
290289
" else:\n",
291290
" if i + batch_size >= max_index:\n",
292291
" i = min_index + lookback\n",

0 commit comments

Comments
 (0)