/// <summary>
        /// Loads the standard data from file.
        /// </summary>
        /// <returns>Collection with datas</returns>
        public static TrainingCollection LoadStandardData()
        {
            const int HOW_MANY_NUMBERS_TO_LEARN_FROM_FILE = 1000;
            TrainingCollection collection = new TrainingCollection(HOW_MANY_NUMBERS_TO_LEARN_FROM_FILE);

            GiveItemsFromFile itemReturner = new GiveItemsFromFile();
            sbyte[,] expectedResultFromFile = itemReturner.GiveArrayOfExpectedResults();
            sbyte[,] trainDataFromFile = itemReturner.GiveArrayOfTrainData();
            const int NUMBER_OF_RESULTS = 10;
            const int SIZE_OF_IMAGE = 28 * 28;

            for (int numberCounter = 0; numberCounter < HOW_MANY_NUMBERS_TO_LEARN_FROM_FILE; numberCounter++)
            {
                double[] expectedResult = new double[NUMBER_OF_RESULTS];
                int whatNumber = -1;
                for (int i = 0; i < NUMBER_OF_RESULTS; i++)
                {
                    expectedResult[i] = expectedResultFromFile[numberCounter, i];
                    if (expectedResult[i] == 1)
                        whatNumber = i;
                }

                double[] trainData = new double[SIZE_OF_IMAGE];
                for (int i = 0; i < SIZE_OF_IMAGE; i++)
                {
                    trainData[i] = trainDataFromFile[numberCounter, i];
                }

                TrainingSet trainingSet = new TrainingSet();
                trainingSet.Input = trainData;
                trainingSet.Response = expectedResult;
                trainingSet.Value = whatNumber;

                collection.Values.Add(trainingSet);
            }

            return collection;
        }
        /// <summary>
        /// Teaches the network or recognize number.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The arguments.</param>
        private void TeachNetworkOrRecognizeNumber(object sender, AddNumberOrRecognizeArgs args)
        {
            Rectangle boundsOfLetter = _model.FindBoundsOfPictureOnImageAndReturnRectangle(_neuralNetworkGUI.GiveImageFromDrawingArea(), _pen.Color);

            Bitmap bitmapForFirstLayer = new Bitmap(WIDTH_FOR_BITMAP, HEIGHTH_FOR_BITMAP);
            Graphics g = Graphics.FromImage(bitmapForFirstLayer);
            g.DrawImage(_neuralNetworkGUI.GiveImageFromDrawingArea(),
                new Rectangle(LEFT_MARGIN, UPPER_MARGIN, WIDTH_FOR_BITMAP - 2 * LEFT_MARGIN, HEIGHTH_FOR_BITMAP - 2 * UPPER_MARGIN),
                boundsOfLetter,
                GraphicsUnit.Pixel);

            double[] arrayForFirstLayerOfNetwork = _model.GiveArrayOfIntegersFromImage(bitmapForFirstLayer, _pen.Color);

            Pen newPen = new Pen(Color.Red);
            _graphics.DrawRectangle(newPen, boundsOfLetter);
            _neuralNetworkGUI.RefreshDrawingArea();

            // ------------------------------------------------------------------------
            //TestCuttingImageOfNumberAndTestExchangePixelsForNumber(arrayForFirstLayerOfNetwork);
            // ------------------------------------------------------------------------
            // ------------------------------------------------------------------------
            // TestRecognizingNumbersFromFile();
            // ------------------------------------------------------------------------

            if (args.IsNeededAddingNumber)
            {
                if (args.WhatNumber == -1)
                {
                    MessageBox.Show("Nie zaznaczono liczby do nauki");
                    return;
                }

                double[] expectedResults = new double[NUMBER_OF_RESULTS];
                int whatNumber = 0;
                for (int i = 0; i < NUMBER_OF_RESULTS; i++)
                {
                    if (i != args.WhatNumber)
                    {
                        expectedResults[i] = 0;
                    }
                    else
                    {
                        expectedResults[i] = 1;
                        whatNumber = i;
                    }
                }
                TrainingCollection userTrainingData = TrainingCollection.LoadUserData(_path);
                if (userTrainingData == null)
                    return;

                TrainingSet trainingSet = new TrainingSet();
                trainingSet.Input = arrayForFirstLayerOfNetwork;
                trainingSet.Response = expectedResults;
                trainingSet.Value = whatNumber;
                userTrainingData.Values.Add(trainingSet);
                userTrainingData.SaveUserData(_path);
            }
            else
            {
                // ------------------------------------------------------------------
                TestNetworkUsingTestingDataFromFile();
                // ------------------------------------------------------------------

                _network.ComputeNetworkResponse(arrayForFirstLayerOfNetwork);
                double[] resultFromNetwork = _network.GetResponse();
                double max = -1;
                int index = 0;
                for (int i = 0; i < resultFromNetwork.Length; i++)
                {
                    if (resultFromNetwork[i] > max)
                    {
                        max = resultFromNetwork[i];
                        index = i;
                    }
                }
                _neuralNetworkGUI.SelectNumber(index);
            }
        }