diff --git a/6.3-advanced-usage-of-recurrent-neural-networks.ipynb b/6.3-advanced-usage-of-recurrent-neural-networks.ipynb index 5de9767b00..8088517799 100644 --- a/6.3-advanced-usage-of-recurrent-neural-networks.ipynb +++ b/6.3-advanced-usage-of-recurrent-neural-networks.ipynb @@ -285,8 +285,7 @@ " i = min_index + lookback\n", " while 1:\n", " if shuffle:\n", - " rows = np.random.randint(\n", - " min_index + lookback, max_index, size=batch_size)\n", + " rows = np.random.choice(range(min_index + lookback, max_index), size=batch_size, replace=False)\n", " else:\n", " if i + batch_size >= max_index:\n", " i = min_index + lookback\n", @@ -1157,8 +1156,7 @@ " i = min_index + lookback\n", " while 1:\n", " if shuffle:\n", - " rows = np.random.randint(\n", - " min_index + lookback, max_index, size=batch_size)\n", + " rows = np.random.choice(range(min_index + lookback, max_index), size=batch_size, replace=False)\n", " else:\n", " if i + batch_size >= max_index:\n", " i = min_index + lookback\n",