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
评论列表
文章目录