コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            perceptron = new Perceptron(3);
            learningExamples = new List<LearningExample>();

            liczbaScroll.Value = 100;
            stalaScroll.Value = 0.5;
            isNetworkCreated = false;
        }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: Romaxaqaz/MRO_E-Ticket
 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");
     }
 }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: Romaxaqaz/MRO_E-Ticket
 //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;
     }
 }
コード例 #5
0
 /// <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";
 }
コード例 #6
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();
        }
コード例 #7
0
 public PerceptronEventArgs(Perceptron p)
 {
     perceptron = p;
 }