//[Test]
        public void TestCP_parz()
        {
            double[] w1 = {0.0, 0.0, 0.0};
            double[] w2 = {0, 0, 1.0};
            double[] w3 = {0, 1.0, 0};

            double[] w4 = {0.0, 1.0, 1.0};
            double[] w5 = {1.0, 0.0, 0};
            double[] w6 = {1.0, 0, 1.0};

            double[] w7 = {1.0, 1.0, 0};
            double[] w8 = {1.0, 1.0, 1.0};

            double[][] input = new double[][]{w1,w2,w3,w4,w5,w6,w7,w8};

            /*
            this._networkKohonen2.Layers[0].Alpha = 0.12;
            this._networkKohonen2.Layers[0].Dim = 0;
            this._networkKohonen2.Layers[0].Learn(5000,input);
            */

            _kohonenLearning_parz = new KohonenLearning(this._networkKohonen_parz.Layers[0]);
            _kohonenLearning_parz.LearningRate = 0.12;
            _kohonenLearning_parz.LearningRadius = 0;

            for(int i=0;i<5000;i++){
                _kohonenLearning_parz.LearningRate *= 0.999;
                _kohonenLearning_parz.RunEpoch(input);

            }

            WidrowHoffLearning _widrowHoff = new WidrowHoffLearning(this._networkKohonen_parz.Layers[1]);

            double[] out1 = {0.0,1.0};
            double[] out2 = {1.0, 0.0};
            double[] out3 = {1.0, 0.0};
            double[] out4 = {0.0,1.0};
            double[] out5 = {1.0, 0.0};
            double[] out6 = {0.0,1.0};
            double[] out7 = {0.0,1.0};
            double[] out8 = {1.0, 0.0};

            double[][] output = new double[][]{out1, out2, out3,out4,out5, out6, out7, out8};

            _widrowHoff.LearningRate = 0.6;

            for(int i=0;i<200;i++){
                _widrowHoff.LearningRate *= 0.99;

                int index = 0;

                foreach(double[] wektor in  input){

                    this._networkKohonen_parz.Layers[0].Compute(new List<double>(wektor));
                    IList<double> widrowInput = this._networkKohonen_parz.Layers[0].Outputs;

                    double[] widrowInputArray = new double[8];

                    widrowInput.CopyTo(widrowInputArray,0);

                //	foreach(double d in widrowInputArray)
                //		Console.WriteLine(d + " " );

                    _widrowHoff.Run(widrowInputArray, output[index]);
                    //Console.WriteLine( _widrowHoff.Run(widrowInputArray, output[index%3]));
                    index++;
                }

            }

            Console.WriteLine("wagi:");
            INeuronsCollection neurony = this._networkKohonen_parz.Layers[0].Neurons;

            int counter = 0;
            foreach (INeuron n in neurony)
            {
                foreach (double val in n.Weights)
                {
                    Console.Write(val.ToString("##.###") + "  ||   " );
                    counter++;
                    if(counter % 3 == 0)
                        Console.WriteLine("");
                }
                Console.WriteLine("--------");
            }

            Console.WriteLine("----------------------WARSTWA DRUGA WAGI -----------------------------");

             neurony = this._networkKohonen_parz.Layers[1].Neurons;

             counter = 0;
            foreach (INeuron n in neurony)
            {

                Console.WriteLine("THRESHOLD: " +  n.Threshold);

                foreach (double val in n.Weights)
                {
                    Console.Write(val.ToString("##.###") + "  ||   " );
                    counter++;
                    if(counter % 3 == 0)
                        Console.WriteLine("");
                }
                Console.WriteLine("--------");
            }

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("000.txt"));

            Console.WriteLine("000:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("001.txt"));

            Console.WriteLine("001:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("010.txt"));

            Console.WriteLine("010:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("011.txt"));

            Console.WriteLine("011:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("100.txt"));

            Console.WriteLine("100:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("101.txt"));

            Console.WriteLine("101:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("110.txt"));

            Console.WriteLine("110:")	;
            ShowOut(this._networkKohonen_parz.Outputs);

            this._networkKohonen_parz.Compute(DataLoader.ReadInputs("111.txt"));

            Console.WriteLine("111:")	;
            ShowOut(this._networkKohonen_parz.Outputs);
        }
        public void TestKohonen1()
        {
            //List<List<double>> input = new List<List<double>>();

            /*
            //wektor 1
            List<double> w1 = new List<double> {1, 1, 0, 0};

            //wektor 2
            List<double> w2 = new List<double> {0, 0, 0, 1};

            //wektor 3
            List<double> w3 = new List<double> {1, 0, 0, 0};

            //wekror 4
            List<double> w4 = new List<double> {0, 0, 1, 1};

            input.Add(w1);
            input.Add(w2);
            input.Add(w3);
            input.Add(w4);
            */

            double[] w1 = {1, 1, 0, 0};
            double[] w2 = {0, 0, 0, 1};
            double[] w3 = {1, 0, 0, 0};
            double[] w4 = {0, 0, 1, 1};

            double[][] input = new double[][]{w1,w2,w3,w4};

            /*
            this._networkKohonen.Layers[0].Alpha = 0.6;
            this._networkKohonen.Layers[0].Learn(100,input);
            */

            _kohonenLearning = new KohonenLearning(this._networkKohonen.Layers[0]);
            _kohonenLearning.LearningRate = 0.13;
            _kohonenLearning.LearningRadius = 0;

            for(int i=0;i<4000;i++){

                _kohonenLearning.RunEpoch(input);

            }
            this._networkKohonen.Compute(DataLoader.ReadInputs("Inputs_Kohonen.txt"));

            Console.WriteLine("wagi:");
            INeuronsCollection neurony = this._networkKohonen.Layers[0].Neurons;

            foreach (INeuron n in neurony){
                foreach (double val in n.Weights)
                    Console.WriteLine(val);
                Console.WriteLine("--------");
            }

            Console.WriteLine(this._networkKohonen.Outputs[0] + " " + this._networkKohonen.Outputs[1]);
                Assert.Greater(this._networkKohonen.Outputs[1],this._networkKohonen.Outputs[0] );
        }
        //[Test]
        public void TestCP_2()
        {
            double[] w1 = {1.0, 0.0, 0.0, 0.0, 1.0, 0, 0, 0, 1.0};
            double[] w2 = {1.0, 0, 0, 1.0, 0.0, 0.0, 0, 1.0, 1.0};
            double[] w3 = {1.0, 1.0, 0, 0, 0, 1.0, 0.0, 0.0, 1.0};

            double[] w4 = {1.0, 0, 1.0, 0.0, 1.0, 0, 1.0, 0, 1.0};
            double[] w5 = {0, 1.0, 1.0, 0, 1.0, 0, 1.0, 1.0, 0};
            double[] w6 = {1.0, 0, 0.0, 1.0, 1.0, 1.0, 0, 0, 1.0};

            double[] w7 = {1, 1.0, 1.0, 1.0, 0, 0, 1.0, 0, 0};
            double[] w8 = {0, 1.0, 0.0, 0, 1.0, 0, 1.0, 1.0, 1.0};
            double[] w9 = {1.0, 1.0, 1.0, 0, 0, 1.0, 0, 0, 1};

            double[][] input = new double[][]{w1,w2,w3,w4,w5,w6,w7,w8,w9};

            /*
            this._networkKohonen2.Layers[0].Alpha = 0.12;
            this._networkKohonen2.Layers[0].Dim = 0;
            this._networkKohonen2.Layers[0].Learn(5000,input);
            */

            _kohonenLearning = new KohonenLearning(this._networkKohonen3.Layers[0]);
            _kohonenLearning.LearningRate = 0.02;
            _kohonenLearning.LearningRadius = 0;

            for(int i=0;i<5000;i++){
                _kohonenLearning.LearningRate *= 0.999;
                _kohonenLearning.RunEpoch(input);

            }

            WidrowHoffLearning _widrowHoff = new WidrowHoffLearning(this._networkKohonen3.Layers[1]);

            double[] out1 = {1.0, 0.0, 0.0};
            double[] out2 = {0.0, 1.0, 0.0};
            double[] out3 = {0.0, 0.0, 1.0};

            double[][] output = new double[][]{out1, out2, out3};

            _widrowHoff.LearningRate = 0.06;

            for(int i=0;i<30;i++){
                _widrowHoff.LearningRate *= 0.99;

                int index = 0;

                foreach(double[] wektor in  input){

                    this._networkKohonen3.Layers[0].Compute(new List<double>(wektor));
                    IList<double> widrowInput = this._networkKohonen3.Layers[0].Outputs;

                    double[] widrowInputArray = new double[9];

                    widrowInput.CopyTo(widrowInputArray,0);

                //	foreach(double d in widrowInputArray)
                //		Console.WriteLine(d + " " );

                    _widrowHoff.Run(widrowInputArray, output[index%3]);
                    //Console.WriteLine( _widrowHoff.Run(widrowInputArray, output[index%3]));
                    index++;
                }

            }

            Console.WriteLine("wagi:");
            INeuronsCollection neurony = this._networkKohonen3.Layers[0].Neurons;

            int counter = 0;
            foreach (INeuron n in neurony)
            {
                foreach (double val in n.Weights)
                {
                    Console.Write(val.ToString("##.###") + "  ||   " );
                    counter++;
                    if(counter % 3 == 0)
                        Console.WriteLine("");
                }
                Console.WriteLine("--------");
            }

            Console.WriteLine("----------------------WARSTWA DRUGA WAGI -----------------------------");

             neurony = this._networkKohonen3.Layers[1].Neurons;

             counter = 0;
            foreach (INeuron n in neurony)
            {
                foreach (double val in n.Weights)
                {
                    Console.Write(val.ToString("##.###") + "  ||   " );
                    counter++;
                    if(counter % 3 == 0)
                        Console.WriteLine("");
                }
                Console.WriteLine("--------");
            }

            this._networkKohonen3.Compute(DataLoader.ReadInputs("test_2_1.txt"));

            Console.WriteLine("test 2_1:");
            ShowOut(this._networkKohonen3.Outputs);

            this._networkKohonen3.Compute(DataLoader.ReadInputs("test_2_2.txt"));

            Console.WriteLine("test 2_2:");
            ShowOut(this._networkKohonen3.Outputs);

            this._networkKohonen3.Compute(DataLoader.ReadInputs("test_2_3.txt"));

            Console.WriteLine("test 2_3:");
            ShowOut(this._networkKohonen3.Outputs);
        }