Exemplo n.º 1
0
        /// <summary>
        /// Crea la red neuronal.
        /// </summary>
        public override void CreateANN()
        {
            base.CreateANN();

            // Crea un diccionario vacio
            this.learnedKanjis = new Dictionary<string, Kanji>();

            // Crea la red
            hopfieldNN = new NeuralNetwork(InputSize);
        }
Exemplo n.º 2
0
 private void CreateNNBut_Click(object sender, EventArgs e)
 {
     NN = new NeuralNetwork(imageDim*imageDim);
     panelStoredImages.Controls.Clear();
     NN.EnergyChanged += new EnergyChangedHandler(NN_EnergyChanged);
     Random rnd = new Random();
     int r = 0;
     imNNState.pixels = new int[imageDim, imageDim];
     for (int i = 0; i < imageDim; i++)
         for (int j = 0; j < imageDim; j++)
         {
             r = rnd.Next(2);
             if (r == 0) imNNState.pixels[i, j] = Color.Black.ToArgb();
             else if (r == 1) imNNState.pixels[i, j] = Color.White.ToArgb();                    
         }
     patternSelected = false;
     butAddPattern.Enabled = true;
     butRunDynamics.Enabled = false;
     imNNState.Visible = true;
     imNNState.Invalidate();
     UpdatePropertiesPB();
 }