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

1

1

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.

Bernicebernie answered 16/10, 2016 at 16:37 Comment(2)
Please provide inputs which you pass in calling function and how you want to init neural networkHattiehatton
Updated, sorry for delay.Bernicebernie
B
0

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.

Burroughs answered 10/7, 2017 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.