Skip to content

Commit

Permalink
update data_iter (d2l-ai#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostish authored and mli committed Oct 25, 2017
1 parent 3dd61b2 commit a06ac2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chapter_recurrent-neural-networks/rnn-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def data_iter(batch_size, seq_len, ctx=None):
return time_numerical[pos:pos+seq_len]
for i in range(num_batches):
# 每次读取batch_size个随机样本
i = i * batch_size
examples = idx[i:i+batch_size]
data = nd.array(
[_data(j*seq_len) for j in examples], ctx=ctx)
Expand Down

0 comments on commit a06ac2d

Please sign in to comment.