private void buttonInicializacion_Click(object sender, EventArgs e)
        {
            labelAlerta.Text             = "";
            buttonLimpiar.Enabled        = true;
            buttonPerceptron.Enabled     = true;
            buttonInicializacion.Enabled = true;
            buttonAdaline.Enabled        = true;
            buttonCompetir.Enabled       = true;
            create_error_graphic();
            this.Error_cmp.Series["Perceptron"].Points.Clear();
            this.Error_cmp.Series["Adaline"].Points.Clear();

            this.p = new Perceptron(Int32.Parse(textBoxEpocasMaximas.Text), float.Parse(textBoxLR.Text), lista_puntos, 0);
            p.inicializar();
            bitmap_plano = new Bitmap(respaldo);
            dibujarLinea(false, "perceptron");


            //this.Error_cmp.Series["Adaline"].Points.Clear();

            this.a = new Adaline(Int32.Parse(textBoxEpocasMaximas.Text), float.Parse(textBoxLR.Text), lista_puntos, 0);
            a.inicializar();
            bitmap_plano = new Bitmap(respaldo);
            dibujarLinea(false, "adaline");
        }
예제 #2
0
파일: Program.cs 프로젝트: ktoosiu/MSI
        static void Main(string[] args)
        {
            var    perc   = new Adaline(3);
            double bias   = 1;
            var    inputs = new double[, ]
            {
                { bias, 2, 1 },
                { bias, 2, 2 },
                { bias, 0, 6 },
                { bias, -2, 10 },
                { bias, -2, 0 },
                { bias, 0, 0 },
                { bias, 4, -20 }
            };
            var outputs = new double[]
            {
                1, 1, 1, -1, -1, -1, -1
            };

            Console.WriteLine($"\n eps:{perc.CalculateEpsilon(inputs,outputs)} ");
            perc.Train(inputs, outputs, 1);
            Console.WriteLine();
            //perc.Test(inputs, outputs);
            Console.ReadLine();
        }
예제 #3
0
        public INeuron CreateNeuron(IActivationFunction activationFunction)
        {
            INeuron             neuron = null;
            Func <string, bool> equals = value => string.Equals(Neuron, value, StringComparison.InvariantCultureIgnoreCase);

            if (equals("Perceptron"))
            {
                neuron = new Perceptron(activationFunction, Alpha);
            }
            else if (equals("Adaline"))
            {
                neuron = new Adaline(activationFunction, Alpha);
            }
            else if (equals("BackpropagationNeuron"))
            {
                neuron = new BackpropagationNeuron(activationFunction, Alpha, Momentum, Regularization);
            }
            else if (equals("SOMNeuron"))
            {
                neuron = new SOMNeuron(activationFunction, Alpha);
            }
            else
            {
                Console.WriteLine($"Wrong neuron: {Neuron}");
            }

            return(neuron);
        }
        private void buttonLimpiar_Click(object sender, EventArgs e)
        {
            if ((p != null && p.getCompletado()) || (a != null && a.getCompletado()))
            {
                labelAlerta.Text = "";
                this.Error_cmp.Series["Perceptron"].Points.Clear();
                this.Error_cmp.Series["Adaline"].Points.Clear();
                buttonLimpiar.Enabled = false;
                p = null;
                a = null;
                buttonPerceptron.Enabled     = false;
                buttonInicializacion.Enabled = false;
                buttonCompetir.Enabled       = false;
                buttonAdaline.Enabled        = false;

                lista_puntos = new List <Punto>();
                bitmap_plano = new Bitmap(bitmap_solo_plano);
                respaldo     = new Bitmap(bitmap_solo_plano);
                plano.Image  = bitmap_solo_plano;
                plano.Refresh();
            }
        }
예제 #5
0
        /// <summary>
        /// Creates and returns a new instance of Adaline network </summary>
        /// <param name="inputsCount"> number of inputs of Adaline network </param>
        /// <returns> instance of Adaline network </returns>
        public static Adaline createAdaline(int inputsCount)
        {
            Adaline nnet = new Adaline(inputsCount);

            return(nnet);
        }