请问老师,我按照你2-12的代码,运行报错,是怎么回事啊?
来源:2-11 神经网络的训练--随机梯度下降代码部分

慕粉2038411182
2017-10-21
Traceback (most recent call last):
File "D:/vampire/Network/haha.py", line 128, in <module>
net.SGD(tt,30,50000,0.5)
File "D:/vampire/Network/haha.py", line 35, in SGD
self.update_mini_batch(mini_batch, eta)
File "D:/vampire/Network/haha.py", line 48, in update_mini_batch
delta_nable_b, delta_nabla_w = self.update(x, y)
File "D:/vampire/Network/haha.py", line 107, in update
nabla_w[-l] = np.dot(delta, activations[-l - 1].transpose())
ValueError: shapes (30,30) and (784,) not aligned: 30 (dim 1) != 784 (dim 0)
写回答
1回答
-
卫峥
2017-10-21
你的 net.SGD(tt,30,50000,0.5) 参数给错了吧? 视频里说了 输入是28*28=784,这个不能变。 你的输入却是30*30
00
相似问题