encog-dotnet-core icon indicating copy to clipboard operation
encog-dotnet-core copied to clipboard

System.ArgumentOutOfRangeException when i try to see hidden neuron

Open Spocher opened this issue 8 years ago • 2 comments

I consruct a simple network Network = new BasicNetwork(); Network.AddLayer(new BasicLayer(null, true, 2)); Network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 3)); Network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1)); Network.Structure.FinalizeStructure(); Network.Reset();

And when i try to see structure network Console.WriteLine(string.Format("HiddenLayers {0}", Network.Structure.Layers.Count - 2));//1 input, 1 output Console.WriteLine(string.Format("HiddenUnits {0}", Network.Structure.Layers[1].NeuronCount));

HiddenLayers -good HiddenUnits - System.ArgumentOutOfRangeException

Why is that?

Spocher avatar Apr 26 '17 08:04 Spocher

Console.WriteLine(string.Format("HiddenUnits: {0}", Network.GetLayerNeuronCount(1) ));

jeroldhaas avatar May 01 '17 15:05 jeroldhaas

Looking at Network.Structure.Layers (which is a NeuralStructure type), it looks like the Layers property's private field is set readonly. This ultimately affects FinalizeStructure's ability to set properties of the layers.

I'll see if I can add a test case and a modification to the NeuralStructure class.

jeroldhaas avatar May 02 '17 03:05 jeroldhaas