metacluster.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:word2vec_pipeline 作者: NIHOPA 项目源码 文件源码
def subset_iterator(X, m, repeats=1):
    '''
    Iterates over array X in chunks of m, repeat number of times.
    Each time the order of the repeat is randomly generated.
    '''

    N, dim = X.shape
    progress = tqdm(total=repeats * int(N / m))

    for i in range(repeats):

        indices = np.random.permutation(N)

        for idx in np.array_split(indices, N // m):
            yield X[idx][:]
            progress.update()

    progress.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号