def iterate_minibatches(self,X, y, batchsize, shuffle=False):
assert len(X) == len(y)
if shuffle:
indices = sp.arange(len(X))
sp.random.shuffle(indices)
for start_idx in range(0, len(X) - batchsize + 1, batchsize):
if shuffle:
excerpt = indices[start_idx:start_idx + batchsize]
else:
excerpt = slice(start_idx, start_idx + batchsize)
yield X[excerpt], y[excerpt]
cnn_cascade_lasagne.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录