Encog.Neural.SOM.Training.Neighborhood.BasicTrainSOM.SetAutoDecay C# (CSharp) Method

SetAutoDecay() public method

Setup autodecay. This will decrease the radius and learning rate from the start values to the end values.
public SetAutoDecay ( int plannedIterations, double startRate, double endRate, double startRadius, double endRadius ) : void
plannedIterations int
startRate double The starting learning rate.
endRate double The ending learning rate.
startRadius double The starting radius.
endRadius double The ending radius.
return void
        public void SetAutoDecay(int plannedIterations,
                                 double startRate, double endRate,
                                 double startRadius, double endRadius)
        {
            _startRate = startRate;
            _endRate = endRate;
            _startRadius = startRadius;
            _endRadius = endRadius;
            _autoDecayRadius = (endRadius - startRadius)/plannedIterations;
            _autoDecayRate = (endRate - startRate)/plannedIterations;
            SetParams(_startRate, _startRadius);
        }

Usage Example

        public SOMColors()
        {
            InitializeComponent();

            network = CreateNetwork();
            gaussian = new NeighborhoodRBF(RBFEnum.Gaussian, WIDTH, HEIGHT);
            train = new BasicTrainSOM(network, 0.01, null, gaussian);

            train.ForceWinner = false;

            samples = new List<IMLData>();
            for (int i = 0; i < 15; i++)
            {
                IMLData data = new BasicMLData(3);
                data.Data[0] = RangeRandomizer.Randomize(-1, 1);
                data.Data[1] = RangeRandomizer.Randomize(-1, 1);
                data.Data[2] = RangeRandomizer.Randomize(-1, 1);
                samples.Add(data);
            }

            train.SetAutoDecay(100, 0.8, 0.003, 30, 5);
        }
All Usage Examples Of Encog.Neural.SOM.Training.Neighborhood.BasicTrainSOM::SetAutoDecay