cs231n / cs231n.github.io

Public facing notes page
MIT License
10.12k stars 4.06k forks source link

A bug in assignment2 tensorflow.ipynb #237

Open ghost opened 4 years ago

ghost commented 4 years ago
def __iter__(self):
    N, B = self.X.shape[0], self.batch_size
    idxs = np.arange(N)
    if self.shuffle:
        np.random.shuffle(idxs)
    # Here is the bug, the variable is not used in the generator, so shuffle is not useful
    return iter((self.X[i:i+B], self.y[i:i+B]) for i in range(0, N, B))

and I think should be changed like follows correct