Hi,
How can I store network weights to some List structure, such that I can then average the weights and reload this average?
Lawrence
![]() |
|
|||||
|
||||||
Average network weights
11 posts
• Page 1 of 2 • 1, 2
Average network weightsHi,
How can I store network weights to some List structure, such that I can then average the weights and reload this average? Lawrence
Re: Average network weightsHello,
You may iterate through all neurons and get their [url=Neuron.Weights]weights[/url] and store those anywhere you wish.
Re: Average network weightsAndrew,
I can easily see weights of neurons now, but I am not trying to store network values to average and reload after several trials. I am trying to create a class "Trial" to hold the Layers and Neurons. However, your "Layer" is an abstract class! How can I create a constructor something like the code below? Cannot create an instance of the abstract class or interface 'AForge.Neuro.Layer' public class Trial { public List<Layer> layersL; Trial(ActivationNetwork trial) { layersL = new List<Layer>(); foreach (var tLayer in trial.Layers) { Layer layer = new AForge.Neuro.Layer(); //PROBLEM HERE List<Neuron> neuronL = new List<Neuron>(); foreach (var neuron in tLayer.Neurons) { neuronL.Add(neuron); } layer.Neurons = neuronL.ToArray<Neuron>(); } layersL.Add(layersL); } }
Re: Average network weightsThanks Andrew,
That helps, but I now can't assign to "Neurons"; network = new ActivationNetwork( new BipolarSigmoidFunction(sigmoidAlphaValue), 5,5,1); foreach (var tLayer in network.Layers) { ActivationLayer layer = new ActivationLayer(tLayer.Neurons.Count(),tLayer.InputsCount,null); layer.Neurons = (AForge.Neuro.Neuron[]) tLayer.Neurons.Clone(); //PROBLEM HERE }
Re: Average network weights
You can not set neurons into layer, only get them. The docs should mention this.
Re: Average network weightsSo I want to set the weight of each Neuron, based on an average of several previous training runs.
Is this not possible?
Re: Average network weightsAndrew,
I am saving neuron weights and later restoring. I loop through all Layers / Neurons / Weights But I get different results - is there something else in the Network apart from Neuron weights that I need to store?
Re: Average network weightsYep. You need to store ActivationNeuron.Threshold. It also updates will learning network.
11 posts
• Page 1 of 2 • 1, 2
|
![]() |
|