Skip to content

Commit

Permalink
Fix out of range bug in optimizer.run
Browse files Browse the repository at this point in the history
indices has the shape of n * n_per_epoch in line 681. 
i + j * n_per_epoch did cause an out of range error when n_per_epoch was greater than n.
  • Loading branch information
Mazelt authored Feb 25, 2020
1 parent b17d4b6 commit 3f0c76e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Compiler/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def _(j):
indices = indices_by_label[label]
@for_range_multithread(self.n_threads, 1, n)
def _(i):
idx = indices[i + j * n_per_epoch]
idx = indices[i + j * n]
self.layers[0].X[i + label * n] = X[idx]
self.forward(None)
self.backward()
Expand Down

0 comments on commit 3f0c76e

Please sign in to comment.