向 Encog 网络添加偏置神经元

发布于 2024-09-04 12:27:49 字数 413 浏览 2 评论 0原文

我正在将一些涉及人工神经网络的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请爱~陌生人 2024-09-11 12:27:49

好吧,我知道这个!我是 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文