Skip to content

Commit 39bb701

Browse files
bmccannsoumith
authored andcommitted
curriculum off by one
1 parent 4214691 commit 39bb701

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

OpenNMT/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def trainModel(model, trainData, validData, dataset, optim):
180180
start_time = time.time()
181181
def trainEpoch(epoch):
182182

183-
if opt.extra_shuffle and epoch >= opt.curriculum:
183+
if opt.extra_shuffle and epoch > opt.curriculum:
184184
trainData.shuffle()
185185

186186
# shuffle mini batch order
@@ -192,7 +192,7 @@ def trainEpoch(epoch):
192192
start = time.time()
193193
for i in range(len(trainData)):
194194

195-
batchIdx = batchOrder[i] if epoch >= opt.curriculum else i
195+
batchIdx = batchOrder[i] if epoch > opt.curriculum else i
196196
batch = trainData[batchIdx]
197197

198198
model.zero_grad()

0 commit comments

Comments
 (0)