向 Encog 网络添加偏置神经元
我正在将一些涉及人工神经网络的 C 代码移植到 Java。我决定使用 Encog 框架。
我希望我的网络有一个连接到隐藏层和输出层的偏置神经元(使用加权突触并始终输出 1.0);它们在此图表中用绿色标记。
如何以编程方式创建这样的网络?每个偏置神经元都应该有自己的层吗?我尝试为每个偏置神经元实例化一个BasicLayer,但这似乎没有任何效果,即使该层通过WeightedSynapse连接。
谢谢你,
马丁·维博
I am porting some C code involving an artificial neural network to Java. I have decided to use the Encog framework.
I would like my network to have a bias neuron (which uses weighted synapses and always outputs 1.0) connected to hidden layers and the output layer; they are marked with green in this graph.
How can I create such a network programmatically? Should every bias neuron have its own layer? I have tried to instantiate a BasicLayer for every bias neuron, but this does not seem to have any effect even though the layer is connected via a WeightedSynapse.
Thank you,
Martin Wiboe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我知道这个!我是 Encog 的主要开发人员之一。 :)
我们在 Encog 2.4(测试版)中增强了对此的支持,但即使是当前版本也支持这一点。在 Encog 2.3 中,偏差称为阈值。因此,创建您的图层并指定您想要的阈值。基本上,这会为您指定的具有阈值的每个层创建偏差输入。我将它们全部构建到同一层中,因为它提高了性能,所有的结果都是一样的。
我们实际上对此进行了讨论,并且我们在 Encog 2.4 中将其变得更加清晰。您可以在这里阅读讨论。
http://www.heatonresearch.com/node/1477
OKay, I know this one! I am one of the primary Encog developers. :)
We enhanced support for that in Encog 2.4(which is in beta), however even the current version supports this. In Encog 2.3 bias is called threshold. So create your layers specifying that you WANT threshold values. Basically this creates the bias inputs for each of the layers that you specify having threshold values on. I build it all into the same layer because it improves performance, it all works out the same.
We actually had a discussion about this, and we are making it clearer in Encog 2.4. You can read the discussion here.
http://www.heatonresearch.com/node/1477