hanbt / learn_dl

Deep learning algorithms source code for beginners
Apache License 2.0
1.19k stars 988 forks source link

python3 中的bp.cy #49

Open lsjAI opened 5 years ago

lsjAI commented 5 years ago

python3/bc.py 运行 总是报错 'ConstNode' object has no attribute 'set_output'

fyx18 commented 4 years ago

我也是,请问解决了吗

Xanyv commented 4 years ago

我也是的 解决了吗

bluetropic commented 3 years ago

ConstNode不需要设置,output恒等1. 程序中Layer这个类里边的set_output(self, data): 中 for i in range(len(data)): self.nodes[i].set_output(data[i]) 改为 for i in range(len(self.nodes)): self.nodes[i].set_output(data[i]),其他的类似constnode爆出的错误,也是因为这个原因产生的,依次修改即可。

ren1024pro commented 3 years ago

main中的每层的node数设错了 if name == 'main': 中 net = Network([6, 4, 2]) 参考之前的bp 和 fc应该是 net = Network([8, 3, 8]) 这样是跑通的别的还不确认