utils.py 文件源码

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

项目:IDNNs 作者: ravidziv 项目源码 文件源码
def get_data(name):
    """Load data from the given name"""
    gen_data = {}
    # new version
    if os.path.isfile(name + 'data.pickle'):
        curent_f = open(name + 'data.pickle', 'rb')
        d2 = cPickle.load(curent_f)
    # Old version
    else:
        curent_f = open(name, 'rb')
        d1 = cPickle.load(curent_f)
        data1 = d1[0]
        data = np.array([data1[:, :, :, :, :, 0], data1[:, :, :, :, :, 1]])
        # Convert log e to log2
        normalization_factor = 1 / np.log2(2.718281)
        epochsInds = np.arange(0, data.shape[4])
        d2 = {}
        d2['epochsInds'] = epochsInds
        d2['information'] = data / normalization_factor
    return d2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号