Encog RBF C#, Total number of RBF neurons must be some integer to the power of 'dimensions'

夙愿已清 提交于 2019-12-11 06:28:37

问题


I get constantly error Total number of RBF neurons must be some integer to the power of 'dimensions' with using method SetRBFCentersAndWidthsEqualSpacing in C#.

Can someone who is familiar with RBF network in Encog check the line 232 in RBFNetwork.cs. I think there is maybe a bug or I miss something:

var expectedSideLength = (int) Math.Pow(totalNumHiddenNeurons, 1.0d/dimensions); 
double cmp = Math.Pow(totalNumHiddenNeurons, 1.0d/dimensions); 
if (expectedSideLength != cmp) -> error

these two variables can't be equal, because (int) rounds the number. It's coincidence that it works for XOR example, it won't work with different dimenson like 19 for example.

This is how I create RBF network:

dataSet is VersatileMLDataSet 
RBFNetwork n = new RBFNetwork(dataSet.CalculatedInputSize, dataSet.Count, 1, RBFEnum.Gaussian);
n.SetRBFCentersAndWidthsEqualSpacing(0, 1, RBFEnum.Gaussian, 2.0/(dataSet.CalculatedInputSize * dataSet.CalculatedInputSize), true);

My dataset has 19 attributes (dimension) with 731 records.


回答1:


The number of hidden neurons is an integer raised to the power of the number of input neurons. So if you have 3 input attributes and a window size of 2, hidden neurons would be any integer (say 3) raised to the power of 6 (3 x 2) or 729. This limits the number of input attributes and window size as the number of hidden neurons gets very large very quickly.



来源:https://stackoverflow.com/questions/40072675/encog-rbf-c-total-number-of-rbf-neurons-must-be-some-integer-to-the-power-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!