【发布时间】:2016-08-08 19:57:22
【问题描述】:
我有一些数据想输入卷积神经网络。
for ranking_list in train:
home_exp = []
away_exp = []
exp = []
home_team = ranking_list[:16]
away_team = ranking_list[16:]
count = 0
for h in home_team:
row_h = []
row_a = []
for a in away_team:
count += 1
ex_h, ex_a = values(h,a)
row_h.append(ex_h)
row_a.append(ex_a)
home_exp+=row_h
away_exp+=row_a
exp = np.array(home_exp + away_exp)
reformatted_training.append(np.reshape(exp, [-1, 16,16,2]))
我有一个排名列表,其中包含 32 个排名,其中 16 个与主队有关,16 个与客队有关,因此该列表分为两个 16 个元素列表。
然后使用这些排名的每个排列来生成两个值,ex_h 和 ex_a。
我脑海中的画面是,我想输入具有两个通道(一个用于 ex_h 值,一个用于 ex_a 值)的 16x16 图像。
我打电话给np.reshape 是否实现了这一点,我发现很难想象这一点。我也对-1 以及为什么 TensorFlow 需要 4 级张量感到有些困惑。
【问题讨论】:
标签: numpy tensorflow