public MainWindow()
        {
            InitializeComponent();
            perceptron = new Perceptron(3);
            learningExamples = new List<LearningExample>();

            liczbaScroll.Value = 100;
            stalaScroll.Value = 0.5;
            isNetworkCreated = false;
        }
 public PerceptronViewer()
 {
     InitializeComponent();
     lform.FormClosing += Lform_FormClosing;
     ObjectSerializer<Perceptron> objSerializer = new ObjectSerializer<Perceptron>();
     Perceptron yourObjectFromFile = objSerializer.GetSerializedObject(PathObjectSerializer);
     if (yourObjectFromFile != null)
     {
         per = yourObjectFromFile;
     }
     else
     {
         per = new Perceptron(6400, 3200);
     }
     Load += PerceptronViewer_Load;
 }
Exemple #3
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     ObjectSerializer<Perceptron> objSerializer = new ObjectSerializer<Perceptron>();
     Perceptron yourObjectFromFile = objSerializer.GetSerializedObject(PathObjectSerializer);
     if (yourObjectFromFile != null)
     {
         per = yourObjectFromFile;
     }
     else
     {
         MessageBox.Show("Perceptron not trained");
     }
 }
Exemple #4
0
 //save collection image
 private void DividedIntoImageButton_Click(object sender, EventArgs e)
 {
     ObjectSerializer<Perceptron> objSerializer = new ObjectSerializer<Perceptron>();
     Perceptron yourObjectFromFile = objSerializer.GetSerializedObject(PathObjectSerializer);
     if (yourObjectFromFile != null)
     {
         per = yourObjectFromFile;
     }
     else
     {
         MessageBox.Show("Perceptron not trained");
     }
     Segmentation segment = new Segmentation(null, null);
     numberImageCollection = segment.GetCollectionofImage(DividedImageList, DividedImage);
     ImageFormat format = ImageFormat.Bmp;
     SaveFileDialog saveFileDialog = new SaveFileDialog();
     if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         int x = 0;
         DividedimageList1.ImageSize = new Size(50, 50);
         foreach (var item in numberImageCollection)
         {
             item.bitmap.Save(saveFileDialog.FileName + item.Name + ".bmp", format);
             DividedimageList1.Images.Add(Image.FromFile(saveFileDialog.FileName + item.Name + ".bmp"));
             DividedListView.Items.Add("image", x++);
         }
         DividedListView.LargeImageList = DividedimageList1;
     }
 }
 /// <summary>
 /// Funkcja przeznaczona przywrócenia domyślnych wartości interfejsu
 /// </summary>
 private void resetAll()
 {
     learningExamples = new List<LearningExample>();
     perceptron = new Perceptron(3);
     canvas.Children.Clear();
     console.Text = "";
     network = new MLPNetwork(3, learningExamples);
     isNetworkCreated = false;
     liczbaPerceptronowText.Text = "0";
 }
        /// <summary>
        /// Zdarzenie przechwytywane w momencie naciśnięcia przycisku uczenia perceptronu
        /// </summary>
        private void pocketButton_Click(object sender, RoutedEventArgs e)
        {
            perceptron = new Perceptron(3);
            println(perceptron.Weights.ToString());

            // Uczy perceptron
            println(perceptron.pocketLearn((int)liczbaScroll.Value, stalaScroll.Value, learningExamples).ToString());

            // Rysuje linie na podstawie nauczonego perceptronu
            drawLine();
        }
 public PerceptronEventArgs(Perceptron p)
 {
     perceptron = p;
 }