generate_norb_small.py 文件源码

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

项目:Generative-ConvACs 作者: HUJI-Deep 项目源码 文件源码
def get_val_indices(m_total, m_val, info_mat):
    all_idxs = np.arange(m_total)    
    val_idxs = np.array([])
    for i in range(NUM_CLASSES):
        cat_for_val = np.random.choice(TR_CATS,1)[0]
        all_class_idxs = all_idxs[( all_idxs % NUM_CLASSES == i)]
        class_info = info_mat[all_class_idxs]
        sel_class_idxs = np.where(class_info[:,0] == cat_for_val)[0]
        val_idxs = np.concatenate((val_idxs,all_class_idxs[sel_class_idxs]))
    np.random.shuffle(val_idxs)
    return val_idxs.astype(np.uint)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号