Hello, first time learning neural network, your article is very suitable for me, but I want to know why -1 is needed in many places, such as: nextLayer.Total() - 1, so that it does not match the number of neurons in the next layer .
Hello, first time learning neural network, your article is very suitable for me, but I want to know why -1 is needed in many places, such as: nextLayer.Total() - 1, so that it does not match the number of neurons in the next layer .
Hi, it's normal work with array. At mql5 all array index start form 0. And nextLayer.Total() return total number of neurons. So if it back 10 that mean elements of array have indexes from 0 to 9.
你好,德米特里、
几个星期以来,我一直在学习你的 "神经网络 "系列的前两部分内容,在循环浏览神经元(或其他内容)时,我总是发现下面的代码。
我真的不明白--在我看来,这样总是会遗漏最后一个元素。Total()函数 应该返回一个计数,然后再删除一个,并在 for 循环中使用"<"。因此,如果 Total() 的计数是 2,则只需运行 for 循环一次。
我漏掉了什么?
谢谢、
德尔夫
在某些代码中,您写了类似的内容:
但假设层中有 20 个神经元,我们给总变量赋值为 19 [int total=Layer.Total()-1] 所以现在总变量等于 19,当我们遍历索引 0-18 的神经元时(总变量=19),我们永远不会到达索引 19(最后一个神经元),我认为我们必须用以下方式修改代码:
或
来到达层上的最后一个神经元。
您有什么想法?
在某些代码中,您写了类似的内容:
但假设层中有 20 个神经元,我们将总变量赋值为 19 [int total=Layer.Total()-1] 所以现在总变量等于 19,当我们遍历索引 0-18 的神经元时(总变量=19),我们永远不会到达索引 19(最后一个神经元),我认为我们必须用以下方式修改代码:
或
来到达层上的最后一个神经元。
你有什么想法?
每一层我们都会增加一个神经元进行贝叶斯转移。因此,在调用函数 创建有 20 个神经元的层时,我们会创建 21 个神经元。Layer.Total() 将返回 21。但输入数据只有 20 个元素。最后一个贝叶斯神经元的输出总是 "1"。因此我使用 Layer.Total()-1。在循环中,我使用了"<",因为数组的第一个元素索引为 "0"。
新文章 神经网络轻松制作已发布:
作者:Dmitriy Gizlyk
Hello, first time learning neural network, your article is very suitable for me, but I want to know why -1 is needed in many places, such as: nextLayer.Total() - 1, so that it does not match the number of neurons in the next layer .
Hello, first time learning neural network, your article is very suitable for me, but I want to know why -1 is needed in many places, such as: nextLayer.Total() - 1, so that it does not match the number of neurons in the next layer .
Hi, it's normal work with array. At mql5 all array index start form 0. And nextLayer.Total() return total number of neurons. So if it back 10 that mean elements of array have indexes from 0 to 9.
实际上,我在下载文件时遇到了编译错误。
请尝试使用 GetPointer 函数。
嗨,Dmitriy,感谢您提供这篇文章。请问如何解决这个错误?
嗨,穆罕默德,你修复了这个错误吗?